Copied to clipboard

Flag this post as spam?

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


  • ru 4 posts 24 karma points
    Aug 25, 2011 @ 10:13
    ru
    0

    Examine Lucene Partial Matching on Non English Words

    Hi,

    I am using umbraco 4.7, currently have examine set up and able to search a site, however i wish to search on product codes which are not english words and also partial matching on product codes. e.g.

    product 1 - RTGUHJK

    product 2 - RTGUTTT

    product 3 - RFGGUUI

    so if i search for "RTG" i want examine to return product 1 and 2, however since they are not dictionary words they are not found using wildcard searching such as *.

     

    What i have tried

    - I have used a WhitespaceAnalyzer instead of a StandardAnalyzer

    - I have examined the index and the related field and the codes are being indexed

    - wildcard (*) expressions do not work

     

    In theory i would like the search to apply a contains() or startsWith() logic in order to find the related document.

     

    Any help or advice is greatly appreciated

    Thank You

    R

     

     

  • ru 4 posts 24 karma points
    Sep 08, 2011 @ 12:30
    ru
    0

    any reply on this???

    so much for "

    The friendliest CMS community on the planet

    "

     

  • Deci 19 posts 48 karma points
    Sep 08, 2011 @ 14:15
    Deci
    0

    I don't think them being dictionary words has anything to do with it as they are either in the index and searchable or not.

    For your wildcard lookup did you lookinto using .MultipleCharacterWildCard() ?

  • ru 4 posts 24 karma points
    Sep 08, 2011 @ 14:52
    ru
    0

    thank you for your reply

    the product codes do exist within the index i have used MultipleChracterWildCard which works for codes "starting with" the search query but not for contains

    e.g.

    product code: RTGUHJK

    searching RTG

    gives RTGUHJK

    however searching TGU

    returns nothing

    i have tried to enable leading wild card characters as per this post:

    http://our.umbraco.org/forum/developers/api-questions/12168-Examine-Leading-wildcards?p=1

    however still not working, no results returned

    any suggestions?

     

  • ru 4 posts 24 karma points
    Sep 08, 2011 @ 15:02
    ru
    0

    ok i have manged to get this working as follows:

    sc.GroupedOr(new string[] {"productCode"},
                            Examine.LuceneEngine.SearchCriteria.LuceneSearchExtensions.MultipleCharacterWildcard("*" + searchQuery)).Compile();

    i was missing "*"

    thanks

    p.s. why is there no documentation / api docs for examine?

     

  • PBrack 20 posts 42 karma points
    Sep 08, 2011 @ 15:33
    PBrack
    0

    I've done a couple of Lucene (using a few APIs, Examine and Sitecore.Search) implementations recently, and I'd like to add a couple of notes you might find useful:

    • Commonly used words are ignored by default, so if you're searching products starting with 'A', you're probably not going to get a resultset.  You'll probably want to disable that in config.  I don't recall if this only applies to the standard analyser...
    • I think adding a boost to products might be a good idea in this scenario.
    • IIRC, the whitespace analyser is case sensitive - helpful to bear in mind in these scenarios.
    • There's some escaping behaviour that happens here too.

    All of this is based on Lucene functionality - Examine isn't much of an expansion from Lucene like Sitecore.Search is, so the Lucene documentation is the place to go here.  I do agree that Examine's documentation is poor, though the Umbraco.tv video is supposed to be very good.

  • Deci 19 posts 48 karma points
    Sep 08, 2011 @ 18:49
    Deci
    0

    I personally only started using Umbraco this week so I have no idea on the docs but like you I do wish they would be more fleshed out in certain places. The joy of open source I guess. Once you work it out you can write the docs and some other poor sod following you won't have the same trauma as you..or me :)

     

Please Sign in or register to post replies

Write your reply to:

Draft