On 7/8/2019 3:08 AM, Midas A wrote:
I have enabled docvalues on facet field but query is still taking time.
How i can improve the Query time .
<field name="cat" type="string" indexed="true" stored="true"
docValues="true" multiValued="true" termVectors="true" /> <!--Category ID-->
*Query: *
<snip>
There's very little information here -- only a single field definition
and the query URL. No information about how many documents, what sort
of cardinality there is in the fields being used in the query, no
information about memory and settings, etc. You haven't even told us
how long the query takes.
Your main query is a single * wildcard. A wildcard query is typically
quite slow. If you are aiming for all documents, change that to q=*:*
instead -- this is special syntax that the query parser understands, and
is normally executed very quickly.
When a field has DocValues defined, it will automatically be used for
field-based sorting, field-based facets, and field-based grouping.
DocValues should not be relied on for queries, because indexed data is
far faster for that usage. Queries *can* be done with docValues, but it
would be VERY slow. Solr will avoid that usage if it can.
I'm reasonably certain that docValues will NOT be used for facet.query
as long as the field is indexed.
You do have three-field based facets -- using the facet.field parameter.
If docValues was present on cat for ALL of the indexing that has
happened, then they will work for that field, but you have not told us
whether rol and pref have them defined.
You have a lot of faceting in this query. That can cause things to be slow.
Thanks,
Shawn