Sunspot `LIKE` query

后端 未结 1 659
忘掉有多难
忘掉有多难 2021-01-14 22:25

I\'m using sunspot. How can I run a LIKE query (LIKE %q%)? I would like to do something like this:

 @search = Sunspot.         


        
1条回答
  •  攒了一身酷
    2021-01-14 23:18

    If you use the standard DisMax handler, it does not support wildcards. You have 2 options:

    a. Activate EdgeNGramFilter:

    
      
        ..
        
        ..
      
    
    

    b. Use nightly build Solr with EDismax Handler.

    See wiki article on sunspot docs or similar question on SO.

    0 讨论(0)
提交回复
热议问题