简体   繁体   中英

Combine Solr Q and FQ search

I need to select all documents in a city of a state, which is the better way to make query faster?

1. q=*:*, fq=state:IL AND city:chicago

2. q=state:IL,  fq=city:chicago

3. q=state:IL AND city:chicago  (not using fq)

If I need to select all documents belong to a person, what would be the best combination? The beginner like me would do this:

 q=state:IL AND city:chicago AND name:smith

Individual filter queries (proposal 2) are faster as they are cached independently and you may reuse them in a different combination together.

But there are other factors such as cache size, eviction, frequency of content updates (that invalidate the caches), and so on.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM