I am working with the following indices *Item*
ItemId - string Description - text (query on this) Categories - Multivalued text (query on this) Sellers - Multivalued text (query on this) SellersString - Multivalued string (Need to facet and filter on this) *ContractItem* ContractItemId - string ItemId - string ContractCode - string (facet and filter on this) Priority - integer (order by priority descending) Active - boolean (filter on this) Say someone is searching for colgate I am doing two queries: First query: q = {!join from=ItemId to=ItemId fromIndex=Item)(Description:colgate OR Categories:colgate OR Sellers:colgate)&facet.field=ContractCode >From the first query I get all the ItemIds and do a second query on Item index using q=ItemId:(Id1 Id2 Id3) and generate facet on SellersString I have to do some custom coding to retain Priority (so that I can sort on it) Following are the issues I am running into: 1) Since there are a lot of Items and ContractItems, the number of Ids becomes large and I had to increase maxBooleanClause (possible performance degradation?) 2) Since I have to return a lot of items from first query, the data size becomes very large (again a performance concern) 3) When a filter is applied on the second query, I have to adjust the facet results of the first query 4) Overall this seems complex Is it possible to do just one query and apply filters (if any) and get results along with facets? Any suggestions on simplifying this and improving performance? Thanks in advance