Php 前缀搜索的Solr模式,如何?

Php 前缀搜索的Solr模式,如何?,php,solr,lucene,full-text-search,Php,Solr,Lucene,Full Text Search,我读了stackoverflow的许多问题,但没有找到答案,即如何进行Solr前缀搜索。例如,我有文本:“solr documentation is unreadable”,我需要找到类似这样的内容:“solr docu*”、“documentation unread*”、“unreadable is so*”,但不是“un*so*”,我制作了如下内容: <fieldType name="prefix_search" class="solr.TextField"> <ana

我读了stackoverflow的许多问题,但没有找到答案,即如何进行Solr前缀搜索。例如,我有文本:“solr documentation is unreadable”,我需要找到类似这样的内容:“solr docu*”、“documentation unread*”、“unreadable is so*”,但不是“un*so*”,我制作了如下内容:

<fieldType name="prefix_search" class="solr.TextField">
  <analyzer>
    <tokenizer class="solr.LowerCaseTokenizerFactory"/>
    <filter class="solr.EdgeNGramFilterFactory" minGramSize="1" maxGramSize="30" side="front"/>
  </analyzer>
</fieldType>

但有时它会返回意外的结果,并使用“un*so*”查询。PHP SolrClient可能有问题?谢谢你的回复

正是您想要的,然后可以使用curl轻松测试它,如下所示:

curl'http://example.com:8080/solr/select?q=prefix_search:un*+和+前缀搜索:so*'


正是您想要的,然后可以使用curl轻松测试它,如下所示:

curl'http://example.com:8080/solr/select?q=prefix_search:un*+和+前缀搜索:so*'