<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>queries &#8211; Solr.pl</title>
	<atom:link href="https://solr.pl/en/tag/queries/feed/" rel="self" type="application/rss+xml" />
	<link>https://solr.pl/en/</link>
	<description>All things to be found - Blog related to Apache Solr &#38; Lucene projects - https://solr.apache.org</description>
	<lastBuildDate>Wed, 11 Nov 2020 19:47:37 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9</generator>
	<item>
		<title>Quick look: frange</title>
		<link>https://solr.pl/en/2011/05/30/quick-look-frange/</link>
					<comments>https://solr.pl/en/2011/05/30/quick-look-frange/#respond</comments>
		
		<dc:creator><![CDATA[Rafał Kuć]]></dc:creator>
		<pubDate>Mon, 30 May 2011 18:46:57 +0000</pubDate>
				<category><![CDATA[General]]></category>
		<category><![CDATA[frange]]></category>
		<category><![CDATA[queries]]></category>
		<category><![CDATA[query]]></category>
		<category><![CDATA[range]]></category>
		<category><![CDATA[solr]]></category>
		<guid isPermaLink="false">http://sematext.solr.pl/?p=270</guid>

					<description><![CDATA[In Solr 1.4 there were a new type of queries presented the frange queries. This new type of queries let you search for a range of values. According to the Solr developers this queries should be much faster from normal]]></description>
										<content:encoded><![CDATA[<p>In Solr 1.4 there were a new type of queries presented the <em>frange </em>queries. This new type of queries let you search for a range of values. According to the Solr developers this queries should be much faster from normal range queries. I thought that I should make a simple test to see how much faster, the new range queries can be expected to be.</p>
<p><span id="more-270"></span></p>
<h2>Querying Solr</h2>
<p>To use the <em>frange </em>query syntax we will need to modify the query. So far, the range query of the data may look as follows:
</p>
<pre class="brush:xml">fq=test_si:[0+TO+10000]</pre>
<p>The same query made using the <em>frange </em>looks like this:
</p>
<pre class="brush:xml">fq={!frange l=0 u=10000}test_si</pre>
<p>Of course, it is also possible to send query for data types other than numbers, for example:
</p>
<pre class="brush:xml">fq={!frange l=adam u=mariusz}name</pre>
<h2>Performance</h2>
<p>The very logic of the test is pretty simple. The  structure of the index contains two fields: <em>id</em>, a unique identifier and  a field <em>namestr</em> (string), which contained the values ​​for which I will  ask. I generated about 100,000 distinct documents. In  addition, in each of the documents the tems in the <em>namestr </em>field are  unique so we will easily be able to determine the percentage of terms  covered by a given query. Then I started to send queries to Solr that covered a certain percentage of terms in the index. Each  of the queries were send multiple times and the execution time of the  queries were summed and divided by the number of queries send. The following table shows the test result:</p>
[table “6” not found /]<br />

<p>As you can see a standard range query is faster only for queries that cover a small number of terms  from the given field. As you can see, the performance gain using the <em>frange </em>queries is starts from about 5% of terms covered.   Interestingly, we get a nice increase in query speed, which is encouraging for even faster searching.</p>
<h2>To sum up</h2>
<p>The results of my test are different in terms of performance to what Yonik Seeley wrote on his blog (my test data can be the cause of this), but what we can say is that using frange queries we can expect an increase in performance for queries that need to search for a range of values.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://solr.pl/en/2011/05/30/quick-look-frange/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
