Partager via


Vector-Space Queries

Note

Indexing Service is no longer supported as of Windows XP and is unavailable for use as of Windows 8. Instead, use Windows Search for client side search and Microsoft Search Server Express for server side search.

 

Vector-space queries return documents that match a list of words and phrases. The rank of each document indicates how well the document matches the query. To specify a vector-space query, use the following syntax.

For Dialect 1

method,term,term

For Dialect 2

{vector RankMethod = method} {ve} query terms {/vector}

For Dialect 2, a vector-space query specification must be closed with the {/vector} tag. The RankMethod attribute specifies the ranking algorithm to use to evaluate the rank of a query match. The following table shows supported ranking methods for each dialect.

Method Dialect 1 Dialect 2
Jaccard coefficient --Jaccard-- RankMethod=Jaccard
Dice coefficient --Dice-- RankMethod=Dice
Inner product --Inner-- RankMethod=Inner
Minimum --Minimum-- RankMethod=Minimum
Maximum --Maximum RankMethod=Maximum

 

If any other method is specified, it is ignored and the engine uses the default ranking algorithm, the Jaccard coefficient.

The {ve} tag is a vector element tag. It specifies that the following query specification is an element of the vector query. All the text following the {ve} tag up to the next {ve} tag is interpreted as a query. There is no closing tag for {ve}.

The following table gives several examples of vector-space queries.

To Search For Example Results
Documents containing a list of specified words.
Dialect 1
--Maximum--, light, bulb
Dialect 2
{vector RankMethod=Jaccard} {ve} light {ve} bulb {/vector}
—Or—
light, bulb
Documents with one or both words. Documents with both words are ranked higher than those with only one.
Documents containing a list of specified prefixes, words, and phrases.
Dialect 1
—Jaccard--, invent*, light[333], bulb[100], "light bulb"[600]
Dialect 2
{vector RankMethod=Jaccard} {ve} {generate method=prefix} invent {/generate} {ve} {weight value=0.3} light {weight value=0.1} bulb {weight value=0.6} {phrase} light bulb {/phrase} {/vector}
—Or—
invent*, {weight value=0.3} light, {weight value=0.1} bulb, {weight value=0.6} "light bulb"
Documents containing words prefixed by invent, the words light and bulb, and the phrase light bulb. Documents containing the phrase light bulb are ranked before those containing light, which precede those containing bulb.
Documents containing a complex list of words, phrases, property values, and inflected forms.
{vector RankMethod=Jaccard} {ve} {weight value=0.2} printers **‹**OR{coerce} "print driver" {ve} {prop name = DocTitle} {freetext} Hewlett Packard HP laserjet laser printer {/freetext} {ve} @contents hang** {/vector}
Documents containing the word printers**‹** or the phrase print driver**›**; the value-type property DocTitle, which contains any of the words Hewlett, Packard, HP, laserjet, laser, printer; or inflectional forms of the word hang.