Solr Query with LIKE Clause

后端 未结 2 1628
旧时难觅i
旧时难觅i 2021-02-15 01:44

I\'m working with Solr and I\'d like to know if it is possible to have a LIKE clause in the query. For example, I want to know all organizations with \"New York\" in the title.

2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-02-15 02:27

    You just search for "New York", but first you need to properly configure your field's analyzer. For example you might want to start with a field type like text_general as defined in the default Solr schema. This field type will tokenize on whitespace and other common word separators, then apply a filter of stopwords, then lowercase the terms in order to make searches case-insensitive.

    More information about analyzers in the Solr wiki.

提交回复
热议问题