Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Jenni Marsh 26 posts 46 karma points
    Sep 05, 2012 @ 15:49
    Jenni Marsh
    0

    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)

    My indexer is configured like this:

    <add name="ProductIndexer" type="UmbracoExamine.UmbracoContentIndexer, UmbracoExamine"supportUnpublished="false" analyzer="Lucene.Net.Analysis.Standard.StandardAnalyzer, Lucene.Net" indexSet="ProducttIndexSet"/>

    Can anyone help please?
    Jenni
    xx

  • Jenni Marsh 26 posts 46 karma points
    Sep 11, 2012 @ 17:32
    Jenni Marsh
    0

    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(SearchTermFalse)

     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

Please Sign in or register to post replies

Write your reply to:

Draft