Copied to clipboard

Flag this post as spam?

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


  • Darren 14 posts 34 karma points
    Jul 03, 2013 @ 00:19
    Darren
    0

    Examine query stripping out words

    Hi

    I have examine up and running however my query is having words stripped out

    for example:

    I am searching on "man on the moon" with the following line of code, the variable "searchTerm" should contain "man on the moon":

    var Searcher = ExamineManager.Instance.SearchProviderCollection["MySearcher"];
    var searchCriteria = Searcher.CreateSearchCriteria();

    var query = searchCriteria.Field("Name", searchTerm).Compile();

    however, the query is generated as this when I debug:

    { SearchIndexType: , LuceneQuery: +Name:"man moon" }

    notice how it has removed the words "on the" from the searchTerm. why is this? any ideas?

  • Tim 1193 posts 2675 karma points MVP 3x c-trib
    Jul 04, 2013 @ 16:25
    Tim
    0

    By default Lucene will strip out certain "stop words" these are noise words like "and, or, the" that are not indexed ot save space on indexes. To get rid of the stop words, you need to use a different analyzer for the indexer. I think the default is the StandardAnalyzer which has stop words, you could try the SimpleAnalyzer, which I think doesn't have stop words?

Please Sign in or register to post replies

Write your reply to:

Draft