the store attribute of a lucene field

前端 未结 2 933
灰色年华
灰色年华 2021-02-02 17:02

There is a constructor of lucene Field:

Field(String name, String value, Store store, Index index)

For example I can create a new field by:

2条回答
  •  长情又很酷
    2021-02-02 17:46

    Stored fields are what is returned when you ask Lucene to give you back a document. They hold the original value of a field, with no analysis. You can use them to present the document to the users (not necessarily all fields).

    Stored fields that are not indexed are useful to store meta-data about a document that the user won't use to query the index. An example might be a database id where a document comes from. This id will never be used by the user since they does not know about it, so it is generally useless to index it. But if you store it, so you can use it to gather extra information from your db at runtime.

    The difference between a query and a search is rather subjective. For myself, a search is really the general act of searching in the index while a query is the actual query string used to search the index.

提交回复
热议问题