lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Furkan KAMACI <furkankam...@gmail.com>
Subject Re: Slow query at first time
Date Mon, 16 Sep 2013 16:29:39 GMT
What is query time of your search?

I mean as like that:

QueryResponse solrResponse = query(solrParams);
solrResponse.getQTime();


2013/9/16 Sergio Stateri <stateri@gmail.com>

> Hi,
>
> I´m trying to make a search with Solr 4.4, but in the first time the search
> is too slow. I have studied about pre-warm queries, but the query response
> is the same after putting it. Can anyone help me? Here´s a piece of
> solrconfig.xml:
>
>  <listener event="firstSearcher" class="solr.QuerySenderListener">
>   <arr name="queries">
> <lst>
>   <str name="q">codigoRoteiro:95240816</str>
>   <str name="start">0</str>
>   <str name="rows">20</str>
> </lst>
>   </arr>
> </listener>
>
> in the schema.xml:
>
> <field name="codigoRoteiro" type="integer" indexed="true" stored="true"
> required="true" multiValued="false" />
> </fields>
>
>  <uniqueKey>codigoRoteiro</uniqueKey>
>
> When I start Solr, the following message is shown:
>
> $ java -server -Xms2048m -Xmx4096m -Dsolr.solr.home="./oracleCore/solr"
> -jar start.jar
> .
> .
> .
> 8233 [searcherExecutor-4-thread-1] INFO  org.apache.solr.core.SolrCore  û
> QuerySenderListener done.
> 8235 [searcherExecutor-4-thread-1] INFO  org.apache.solr.core.SolrCore  û
> [db] Registered new searcher
> Searcher@30b6b67dmain{StandardDirectoryReader(segments_6:34
> _f(4.4):C420060)}
>
> And here´s my solrj sample code:
>
> SolrServer solrServer = new HttpSolrServer(solrServerUrl);
>
> SolrQuery query = new SolrQuery();
> query.setQuery("codigoRoteiro:95240816");
>
> query.set("start", "0"); query.set("rows", "20");
> query.addField("codigoRoteiro"); query.addField("rowidString");
> query.addField("descricaoRoteiro"); query.addField("numeroDias");
> query.addField("numeroNoites"); query.addField("dataSaida");
>
> Date initialTime = new Date(); QueryResponse rsp = server.query( query );
> SolrDocumentList docs = rsp.getResults(); Date finalTime = new Date();
> System.out.println("Total timel: " +
> (finalTime.getTime()-initialTime.getTime()) + " ms");
>
>
> The response time is arround 200 ms. If I remove the prewarm query, the
> response time doesn´t change. Shouldn´t the response time be minor when
> using pre-warm query?
>
>
> Thanks in advance,
>
> --
> Sergio Stateri Jr.
> stateri@gmail.com
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message