<div dir="ltr">Hello,<div><br></div><div>Following the discussion with James on prefix strategy being used while indexing, at present, while preparing training file in xapian-letor (prepare_training_file() function in api/letor_internal.cc), the following hard-coded prefixes are added to every query from the query file:</div><div><table border="0" width="100%" style="font-family:sans-serif;table-layout:fixed"><tbody><tr><td valign="top"><div style="overflow:scroll;width:627px"><pre style="color:rgb(0,0,0);background-image:initial;background-repeat:initial">Xapian<span style="color:rgb(128,0,128)">::</span>QueryParser parser<span style="color:rgb(128,0,128)">;</span>
parser<span style="color:rgb(128,128,48)">.</span>add_prefix<span style="color:rgb(128,128,48)">(</span><span style="color:rgb(128,0,0)">"</span><span style="color:rgb(0,0,230)">title</span><span style="color:rgb(128,0,0)">"</span><span style="color:rgb(128,128,48)">,</span> <span style="color:rgb(128,0,0)">"</span><span style="color:rgb(0,0,230)">S</span><span style="color:rgb(128,0,0)">"</span><span style="color:rgb(128,128,48)">)</span><span style="color:rgb(128,0,128)">;</span>
parser<span style="color:rgb(128,128,48)">.</span>add_prefix<span style="color:rgb(128,128,48)">(</span><span style="color:rgb(128,0,0)">"</span><span style="color:rgb(0,0,230)">subject</span><span style="color:rgb(128,0,0)">"</span><span style="color:rgb(128,128,48)">,</span> <span style="color:rgb(128,0,0)">"</span><span style="color:rgb(0,0,230)">S</span><span style="color:rgb(128,0,0)">"</span><span style="color:rgb(128,128,48)">)</span><span style="color:rgb(128,0,128)">;</span>
</pre><pre style="color:rgb(0,0,0);background-image:initial;background-repeat:initial"></pre></div></td></tr></tbody></table>Hence, each query is parsed as follows: title:<query> ... <query>. </div><div><br></div><div>A user might not have this specific metadata storage in the database or could have some other prefixes that were used while indexing. Anyway, the user's query file should take care of any prefixes in the query string by itself.</div><div><br></div><div>Hence, is it a good idea to give hard-coded support for these specific prefixes by default?</div><div><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div style="font-size:12.8px;font-family:arial"><font size="2" color="#666666">----------------------------------------------------------------------------</font></div><div style="font-size:12.8px;font-family:arial"><font size="2" color="#666666">Kind Regards,</font></div><div style="font-size:12.8px"><font size="2" color="#666666" style="font-family:arial">Ayush Tomar</font><font size="2" color="#0000ee" style="font-family:arial"> | <a href="http://ayshtmr.xyz" style="color:rgb(17,85,204)">My Webpage</a></font><font color="#666666" style="font-family:arial"> | <a href="https://in.linkedin.com/in/ayushtomar" style="color:rgb(17,85,204)">LinkedIn</a></font></div></div></div></div></div></div></div></div></div></div>
</div></div>