Solr does not search into integers?

前端 未结 3 639
梦如初夏
梦如初夏 2021-01-15 15:36

I\'m currently developping a search engine using Solr for an ecommerce website. So I get these two fields in my schema.xml:

   

        
3条回答
  •  终归单人心
    2021-01-15 16:06

    Yes add a directive like this in your schema.xml after the field definitions:

    
    

    assuming that the defaultSearchField is set to text.

    To search for all SKUs beginning with 96 you can search for 96*. Keep in mind though this will return all fields (not just SKUs) that begin with 96. To restrict it to SKUs, you will have to search for sku:96*.

提交回复
热议问题