Solrj indexing mechanism

◇◆丶佛笑我妖孽 提交于 2019-12-11 21:12:23

问题


I have a question about indexing mechanism using Solr in Java. If I create a documents and i want to find only field "name", solr will be index all fields? Or only index by field "name" in each document?


回答1:


If you tell Solr to only store the field name in your schema, then only the field name will be stored.

If you instruct Solr to store everything you send to it (like in the schemaless mode) and you send 400 fields, each of those fields will be stored.

If you want to store information but not search for it, only those fields which you are going to query need to be indexed, while the other fields can be limited to just stored. If you don't need the content of the field, but just want to search for it, you can set stored to false, and indexed to true.




回答2:


In the schema.xml where you define the fields getting used, you need to mention indexed=true for all the fields you want to search on.

In your case it would look something like this -

<field name="name" type="string" indexed="true" stored="true" />



来源:https://stackoverflow.com/questions/49362232/solrj-indexing-mechanism

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!