I am assuming you are talking about the terms component and calling the /terms handler. There is no fq support for /terms handler at the moment.
The Terms component works directly on the Terms index and does not have knowledge of live documents. So if you delete a document, and even if a new searcher is opened (through a commit/softCommit), the terms from that document will still show up in the output of the /terms handler, unless of course the document has been completely cleaned up (via a merge). So I doubt if it will work for your use case anyway given the current implementation. There is some preliminary filtering available on the terms themselves via terms.list / terms.ttf or terms.prefix parameters. You can explore these more if you think it solves your use case. https://solr.apache.org/guide/solr/latest/query-guide/terms-component.html#terms-component-parameters Curious to know the scale of your data due to which you are not considering faceting. - Rahul On Tue, Jul 23, 2024 at 10:52 AM ufuk yılmaz <uyil...@vivaldi.net.invalid> wrote: > Hi Alessandro, > > I somehow assumed he was asking about the terms component/handler because > I also needed to use filters with it in the past and failed > > https://solr.apache.org/guide/solr/latest/query-guide/terms-component.html > > — > > > On Jul 23, 2024, at 19:19, Alessandro Benedetti <a.benede...@sease.io> > wrote: > > > > "Out of the box it is not supported, and facet can be used in this use > > case." > > > > What do you mean? > > > > Filtering and faceting are two separate features. > > Filter queries are supported to run in conjunction with any query ( > > > https://solr.apache.org/guide/solr/latest/query-guide/common-query-parameters.html#fq-filter-query-parameter > ), > > they have their own cache and so on as so forth. > > > > Faceting on the other hand can be used to run aggregations and count > terms, > > ranges and much more in the query result list. > > > > You can have different query parsers in filter queries and your query, so > > term queries are not a problem per se. > > > > Cheers > > -------------------------- > > *Alessandro Benedetti* > > Director @ Sease Ltd. > > *Apache Lucene/Solr Committer* > > *Apache Solr PMC Member* > > > > e-mail: a.benede...@sease.io > > > > > > *Sease* - Information Retrieval Applied > > Consulting | Training | Open Source > > > > Website: Sease.io <http://sease.io/> > > LinkedIn <https://linkedin.com/company/sease-ltd> | Twitter > > <https://twitter.com/seaseltd> | Youtube > > <https://www.youtube.com/channel/UCDx86ZKLYNpI3gzMercM7BQ> | Github > > <https://github.com/seaseltd> > > > > > > On Thu, 18 Jul 2024 at 21:33, ufuk yılmaz <uyil...@vivaldi.net.invalid> > > wrote: > > > >> Do you want to filter the terms themselves or do you want to filter the > >> documents and get the terms of the filtered subset? > >> > >> —ufuk > >> > >> — > >> > >>> On Jul 18, 2024, at 1:46, Natarajan, Rajeswari < > >> rajeswari.natara...@sap.com.invalid> wrote: > >>> > >>> Hi, > >>> > >>> Looking to see if we can get terms query working with filters > (extensive > >> filters use case including range filters). Out of the box it is not > >> supported, and facet can be used in this use case. Facet response times > are > >> bad for a large index. > >>> So trying to see if filters can be combined with terms query. Anyone > >> already tried this? > >>> > >>> Thanks, > >>> Rajeswari > >> > >> >