He olly,thanks a lot for your detailed reply.So basically an ESET is formed by ranking terms based on the combined weights((by using something similar to BM25)  assigned to the documents in the Rset (formed by the top 5 entries in the MSET or selected by us ) which are present in the term&#39;s posting list,right ? Cool.:) Read about relevance feedback from a textbook also today,understand it well now,thanks :) <br>
<br>-Regards<br>-Aarsh<br><br><div class="gmail_quote">On Thu, Jan 10, 2013 at 3:42 PM, Olly Betts <span dir="ltr">&lt;<a href="mailto:olly@survex.com" target="_blank">olly@survex.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On Thu, Jan 10, 2013 at 12:33:55PM +0530, aarsh shah wrote:<br>
&gt; Hey guys hi.I am trying to understand how Xapian works .I read the<br>
&gt; Theoretical Background to Xapian doc<br>
&gt; and the report by Salton and Jones.I still cant seem to understand how Eset<br>
&gt; works<br>
<br>
</div>When you do a search with the results sorted by relevance (the default),<br>
you give Xapian some terms (the query) and it gives you the document<br>
ids of the best documents according to a weighting formula which uses<br>
the terms you give it and how frequently they occur in each document and<br>
how many documents they occur in in total.  The returned document ids<br>
are called the &quot;match set&quot; or &quot;MSet&quot; (though &quot;set&quot; is a bit misleading,<br>
as it is ordered).<br>
<br>
The process for forming the &quot;ESet&quot; is very similar, except that the<br>
roles of documents and terms are exchanged (and the mathematical<br>
formulae for the ESet are closely related to those for &quot;TradWeight&quot;).<br>
So you pass in some document ids the user says are relevant (the &quot;RSet&quot;,<br>
or &quot;relevant set&quot; - this one is unordered, so is actually a set in the<br>
mathematical sense) and using those documents and how frequently each<br>
term occurs in them compared to how frequently it occurs in the whole<br>
collection, Xapian computes the ESet.<br>
<br>
The ESet will tend to contain terms which occur more in the documents<br>
in the RSet than you would expect if terms were evenly spread through<br>
the collection.<br>
<br>
If you want to play around with it, you can see it on <a href="http://xapian.org" target="_blank">xapian.org</a> -<br>
e.g. a search for &quot;relevance&quot; gives you a list of suggested expand<br>
terms in a green box:<br>
<br>
<a href="http://xapian.org/search?P=relevance" target="_blank">http://xapian.org/search?P=relevance</a><br>
<br>
As you can see, it makes some good suggestions.<br>
<br>
These are produced by assuming the top 5 (IIRC) documents are relevant.<br>
You can select your own RSet by using the green checkboxes alongside<br>
each result - e.g. if I mark the first and third (which are API and<br>
internal docs for the RSet class) and click &quot;Search&quot; I get (URL<br>
simplified by hand to keep it short):<br>
<br>
<a href="http://xapian.org/search?P=relevance&amp;R=1059&amp;R=55" target="_blank">http://xapian.org/search?P=relevance&amp;R=1059&amp;R=55</a><br>
<br>
You can see that the suggested terms are now more focussed on those<br>
related to the RSet API in particular.<br>
<div class="im"><br>
&gt; How exactly does Xapian add terms to expand a query ?<br>
<br>
</div>It&#39;s up to the developer using Xapian what they do with the terms in the<br>
ESet, but combining them with a query from the user is quite - in C++<br>
you can write:<br>
<br>
    // Parse the query string from the user.<br>
    Xapian::Query q = qp.parse_query(query_string);<br>
<br>
    // OR together all the terms in the ESet.<br>
    Xapian::Query eset_query(Xapian::Query::OP_OR, eset.begin(), eset.end());<br>
<br>
    // And OR together the two.<br>
    q = Xapian::Query(Xapian::Query::OP_OR, q, eset_query);<br>
<div class="im"><br>
&gt; Assuming we have a list of the k most important terms, how do we<br>
&gt; decide which term to add to the query and will be in context with the<br>
&gt; query ?<br>
<br>
</div>I&#39;m not sure quite what you&#39;re asking.  The ESet is formed given an<br>
RSet, which is a set of document ids.  That might come from searching<br>
using a query (as in the first <a href="http://xapian.org" target="_blank">xapian.org</a> search above), but it doesn&#39;t<br>
have to.  There&#39;s no direct connection between the query and the ESet<br>
anyway.<br>
<div class="im"><br>
&gt; And to decide r in W(t)=rw(t), is r obtained from the user every time a<br>
&gt; MSET is returned and is r for the term updated and stored for a term every<br>
&gt; time a query is performed ?<br>
<br>
</div>No, r is &quot;how many of the documents in the given RSet contain term t&quot;.<br>
<br>
Cheers,<br>
    Olly<br>
</blockquote></div><br>