Copied to clipboard

Flag this post as spam?

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


  • Ismail Mayat 4511 posts 10090 karma points MVP 2x admin c-trib
    Oct 31, 2019 @ 17:39
    Ismail Mayat
    0

    Examine create custom searcher with keyword analyser

    In v8 with examine using the api how do you create a searcher with your own analyser? V7 it was all with config.

  • Søren Gregersen 441 posts 1884 karma points MVP 2x c-trib
    Nov 01, 2019 @ 08:57
  • Ismail Mayat 4511 posts 10090 karma points MVP 2x admin c-trib
    Nov 01, 2019 @ 09:01
    Ismail Mayat
    0

    That is index creation, I have already done this with my custom index.

    What I want is a searcher but i want to set the analyser to keyword. In v7 it was just adding config element to searchers in examine config. I do recall seeing way of creating multisearcher but cannot find that code reckon its similar way of creating custom searcher.

  • Ismail Mayat 4511 posts 10090 karma points MVP 2x admin c-trib
    Nov 01, 2019 @ 10:27
    Ismail Mayat
    0

    Ok so there is easy way round this:

    //casting to base so that we can get to overloaded method that allows us to pass in an anlayser
            //in this instance we want keyword because then we can saerch for tags with stop words like And
            var searcher = (BaseLuceneSearcher)index.GetSearcher();
    
            var query = searcher.CreateQuery(HiqhQIndexConstants.ExamineType,BooleanOperation.And,
                                                      new KeywordAnalyzer(), 
                                                      new LuceneSearchOptions()).Field("__IndexType",HiqhQIndexConstants.ExamineType);
    
Please Sign in or register to post replies

Write your reply to:

Draft