Udostępnij za pośrednictwem


Why is searching for large numbers working poorly in Vista?

Say you have a document containing the number 1234567890 (it might be a part number or an invoice number) and another containing the number 1234567891 (presumably the next part or invoice). You want to find the former document so you do Start > Search and type in

1234567890

but the result contains both documents. This is not what you expected and rightly so. What happens is that when a document is indexed and it contains a numeral, vista will index that exact numeral but also a normalized form of that numeral, which is its numeric value. This is primarily so that if you have a document containing something like '1,234' you can find it with a query string such as '1234' that doesn't have the comma. That is a good thing. The problem is that on Vista, if the numeral denotes a sufficiently large number, the numeric value used will be approximate. The numeric values of 1234567890 and 1234567891 will be indistinguishable and that is why searching for one will also return the other.

The best workaround I can think of is using the ~ operator to force a character match. What you have to keep in mind is that ~ will match on the whole string value of a property so usually you have to use * at the beginning and end. Moreover, it cannot search across all properties so you have to know what property to search in. Suppose the numbers you are searching for is in the title property of the documents. Then your query would be:

  • title:~"*1234567890*"

You need to use the doublequotes above so the wildcards are interpreted correctly. If the property you search over simply has the number as the value (as opposed to having the value appear embedded in a piece of text), then you can simplify a bit, for example:

  • subject:=1234567890

Searching for large numbers using WDS on Windows XP does not have this problem and we are looking into improving the behaviour in a future version.