Examine search results: substring returns results, exact match doesn't
Hi Guys!
I have got a load of products that are indexed in Examine, and I am doing searches on part codes. The weird thing is that my searches are returning results if I search for part of the code, but in some cases not if I search for the code exactly.
For example, I have a part code WS-C3750-24FS-S in my database.
If I search for "WS-C3750-24FS-S" then it doesn't return any results. If I search for "WS-C3750-24FS-" (minus the last S) then it doesn't return any results. If I search for "WS-C3750-24FS" (minus the last two characters "-S") then it returns my product!
Another example is the part code BS-START-VCO in my database.
If I search for "BS-START-VCO" then it doesn't return any results. I have to reduce this down to just "BS" before it returns BS-START-VCO.
It looks like Examine has some sort of issue with the hyphens in the product codes. Is it using them as a wildcard or something?
My code to do the search is:
Dim SearchResults = ExamineManager.Instance.SearchProviderCollection("ProductIndex").Search(SearchTerm & "*", True)
Since the help on this forum was not forthcoming, I thought I'd say I've got a solution of sorts. Not really a solution, but a cirumnavigation...
I removed the wildcard testing from the line below:
Dim SearchResults = ExamineManager.Instance.SearchProviderCollection("ProductIndex").Search(SearchTerm & "*", True)
so it changes to:
Dim SearchResults = ExamineManager.Instance.SearchProviderCollection("ProductIndex").Search(SearchTerm, False)
Now it does return exact code searches. I then said that if the exact search didn't return any results then do the wildcard search and return those results, thus to some extent getting the best of both worlds.
Examine search results: substring returns results, exact match doesn't
Hi Guys!
I have got a load of products that are indexed in Examine, and I am doing searches on part codes. The weird thing is that my searches are returning results if I search for part of the code, but in some cases not if I search for the code exactly.
For example, I have a part code WS-C3750-24FS-S in my database.
If I search for "WS-C3750-24FS-S" then it doesn't return any results.
If I search for "WS-C3750-24FS-" (minus the last S) then it doesn't return any results.
If I search for "WS-C3750-24FS" (minus the last two characters "-S") then it returns my product!
Another example is the part code BS-START-VCO in my database.
If I search for "BS-START-VCO" then it doesn't return any results.
I have to reduce this down to just "BS" before it returns BS-START-VCO.
It looks like Examine has some sort of issue with the hyphens in the product codes. Is it using them as a wildcard or something?
My code to do the search is:
My indexer is configured like this:
Since the help on this forum was not forthcoming, I thought I'd say I've got a solution of sorts. Not really a solution, but a cirumnavigation...
I removed the wildcard testing from the line below:
so it changes to:
Now it does return exact code searches. I then said that if the exact search didn't return any results then do the wildcard search and return those results, thus to some extent getting the best of both worlds.
Jenni
is working on a reply...