Solr: exact phrase query with a EdgeNGramFilterFactory

前端 未结 4 1082
谎友^
谎友^ 2021-02-04 17:06

In Solr (3.3), is it possible to make a field letter-by-letter searchable through a EdgeNGramFilterFactory and also sensitive to phrase queries?

By example,

4条回答
  •  感情败类
    2021-02-04 17:53

    Here is what I was thinking -
    For the ngrams to be phrase matched the position of the tokens generated for each word should be the same.
    I checked for the edge grams filter and it increments the tokens, and didn't find any parameter to prevent it.
    There is a position filter available and this maintains the tokens position to the same token as to the begining.
    So if the following configuration is used all tokens are at the same position and it matches the phrase query (same token positions are matched as phrases)
    I checked it through the anaylsis tool and the queries matched.

    So you might want to try the hint :-

    
        
        
        
        
        
        
    
    

提交回复
热议问题