Field having multiple distinct values

前端 未结 3 973
抹茶落季
抹茶落季 2020-12-13 19:24

Am building a \"Book search\" API using Lucene. I need to index Book Name,Author, and Book category fields in Lucene index.

A single book can fall under multiple dis

3条回答
  •  青春惊慌失措
    2020-12-13 20:01

    You can create a simple "category" field, where you list all categrories for a book seperated by spaces.

    Then you can search something like:

    stock market AND category:(+"business")
    

    Or if you want to search in more than one category

    stock market AND category:(+"business" +"philosophy")
    

提交回复
热议问题