简体   繁体   中英

Apache Solr: Can I use solr stats component?

I am using solr for indexing data. I need some statistics information like "max , min , stddev" from indexed data. I read about SolrStatsComponent and I used this too.

I read this line on apache_solr_4_cookbook.pdf

"Please be careful when using this component on the multivalued fields as it can be a performance bottleneck."

My Solr Query

http://localhost:8080/solr/daycore/select?q=*:*&stats=true&stats.field=login_attempts&rows=0

Can I use this query?

schema.xml

<field name="login_attempts" type="long" indexed="true" stored="false"/>

Is it affect solr performance?

You are fine to use the query that you have specified against the login_attempts field you have defined. It is a not a multiValued field. A multiValued field would have the attribute multiValued="true" specified in the schema, which you do not have and is defined as

field may contain multiple values per document, ie if it can appear multiple times in a document

For more information, please refer to SchemaXml on the Solr wiki.

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