Solr的新手 我上传了几个文件。 我可以看到使用get: http://domain:8983/solr/core1/get?id=2
{ "doc": { "id":"2", "cus_name_s":"Paul Brown2", "cus_email_t":["paul.brown@test.net"], "com_id_i":201, "com_name_s":"com1", "url_s":"/integration/", "_version_":1506032461063127040}}
但是当我发出此查询时: http://domain:8983/solr/core1/query?q=cus_email_t:paul&fl=id
我得到了
{
"responseHeader":{
"status":0,
"QTime":1,
"params":{
"fl":"id",
"q":"cus_email_t:paul"}},
"response":{"numFound":0,"start":0,"docs":[]
}}
答案 0 :(得分:0)
分析您的cus_email_t
字段可能不正确。因此,请查看schema.xml
并查看是否存在 - 例如 - 有效的标记生成器,它会拆分您的术语以提取邮件地址。
另一个重点是检查字段定义是否设置为indexed=true
:
<field name="cus_email_t" type="..." indexed=true ... />
答案 1 :(得分:0)
在有关schema.xml的评论中回答您的问题: 默认情况下,solr 5.2.1将为您生成托管架构。如果您尝试更改schema.xml文件,而Solr正在尝试管理您是否会生成另一个托管架构并覆盖您所做的任何更改,因为它意味着要通过REST API进行修改。
如果要在schema.xml中手动更改架构,则需要进入yourcore / solrconfig.xml文件并更改&#34;类&#34; &#34; schemaFactory&#34;的属性标记为&#34; ClassicIndexSchemaFactory&#34;。
-e git+https://github.com/coagulant/django-storages-py3.git@73920742505b0c86b2fbc30274ff8b111e9b6f48#egg=django_storages-origin-py3
现在Solr将读取您的schema.xml文件。标签上方有一个注释块可以解释这一点。
现在,您可以按照上一个答案中的说明更改字段的分析方式。