Solr wildcard query with whitespace

前端 未结 9 1592
悲哀的现实
悲哀的现实 2020-12-06 04:57

I have a wildcard query that looks something like:

q=location:los a*

I\'d like it to match \"los angeles\" and \"los altos\". A query like

9条回答
  •  失恋的感觉
    2020-12-06 05:17

    I had the same problem in my project. When ever I was search for a word along with the whitespace I was not geting the result. So I replaced the whitespace with a hyphen "-" while indexing and querying. Below is the schema.xml snipet which I used to do so:

    
    
    
    
      
        
    
    
    
    
     
        
    
    
    

提交回复
热议问题