<div>Updated Enquire to have a single set method:</div><pre style="margin-top:15px;margin-bottom:15px;padding-top:6px;padding-right:10px;padding-bottom:6px;padding-left:10px;border-top-width:1px;border-right-width:1px;border-bottom-width:1px;border-left-width:1px;border-style:initial;border-color:initial;font:inherit;font-family:&#39;Bitstream Vera Sans Mono&#39;,Courier,monospace;line-height:19px;background-color:rgb(248,248,248);border-top-style:solid;border-right-style:solid;border-bottom-style:solid;border-left-style:solid;border-top-color:rgb(204,204,204);border-right-color:rgb(204,204,204);border-bottom-color:rgb(204,204,204);border-left-color:rgb(204,204,204);overflow-x:auto;overflow-y:auto;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;color:rgb(51,51,51)">
<code style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;border-style:initial;font:inherit;font-family:&#39;Bitstream Vera Sans Mono&#39;,Courier,monospace;line-height:normal;border-top-style:none;border-right-style:none;border-bottom-style:none;border-left-style:none;background-color:transparent;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;border-color:initial;background-image:initial;border-width:initial">    set_parameters_sync( object_parameters)
        Set the parameters to be used for queries.
        The object parameter can have one or more of the following:
          {
            collapse_key: { key: uint32, max: uint32=1},
            docid_order: uint32,
            cutoff: { percent: int32, weight: number=0 },
            sort: [ sort_by_info_1, ... ]
          }
        The sort_by_info object can be:
            RELEVANCE - sorting by relevance
            { key: string, reverse: bool } - sorting by value (with reverse)
            string_value_key - sorting by value
        The valid sort arrays currently are:
            [ RELEVANCE ] - sort_by_relevance
            [ { key: string_value_key, reverse: bool } ] - sort_by_value
            [ string_value_key ] - sort_by_value
            [ { key: string_value_key, reverse: bool }, RELEVANCE ] - sort_by_value_then_relevance
            [ string_value_key, RELEVANCE ] - sort_by_value_then_relevance
            [ RELEVANCE, { key: string_value_key, reverse: bool } ] - sort_by_relevance_then_value
            [ RELEVANCE, string_value_key ] - sort_by_relevance_then_value  </code></pre><br><div class="gmail_quote">On Wed, May 2, 2012 at 11:14 PM, Liam <span dir="ltr">&lt;<a href="mailto:xapian@networkimprov.net" target="_blank">xapian@networkimprov.net</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">List Admin: this list really needs a reply-to header, to prevent accidental off-list replies!<br><br><div class="gmail_quote">
<div class="im">On Wed, May 2, 2012 at 12:32 PM, Marius Tibeica <span dir="ltr">&lt;<a href="mailto:mtibeica@gmail.com" target="_blank">mtibeica@gmail.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="gmail_quote"><div>On Wed, May 2, 2012 at 9:36 PM, Liam <span dir="ltr">&lt;<a href="mailto:xapian@networkimprov.net" target="_blank">xapian@networkimprov.net</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<br><br><div class="gmail_quote"><div>On Wed, May 2, 2012 at 6:32 AM, Marius Tibeica <span dir="ltr">&lt;<a href="mailto:mtibeica@gmail.com" target="_blank">mtibeica@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">




Finished the design of the sync methods: 
<a href="https://github.com/mtibeica/node-xapian/blob/master/docs.md" target="_blank">https://github.com/mtibeica/node-xapian/blob/master/docs.md</a><div>I will probably continue with the creation of a test framework and porting the tests from the Perl binding.<br>




</div></blockquote></div><div><br>Can you look for other places where we can combine multiple methods into a single one with an object argument, as with Query::Query? For instance Enquire::set_sort_* <br></div></div></blockquote>



<div><br></div></div><div>Is is possible to set multiple sort types with Enquire? The method names seem to suggest otherwise to me.</div><div>We could do a set_sort with an array of objects like {  by: &#39;relevance&#39; }, { by: &#39;value&#39;, sort_key: uint32, reverse: &#39;bool&#39;}, and if a succession of these objects is not supported (more than 2 elements, etc), to throw a not yet supported exception. </div>

</div></blockquote></div><div><br>I think an Enquire parameters object could include collapse-key, docid-order, cutoff, value, and a relevance field which can be:<br>  0 or undefined - value ? set_sort_by_value : noop<br>
  1 - value ? set_sort_by_relevance_then_value : set_sort_by_relevance<br>
  2 - value ? set_sort_by_value_then_relevance : set_sort_by_relevance<br><br></div><div class="im"><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div class="gmail_quote">
<div>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_quote"><div>Also for testing, we&#39;d benefit from a simple HTTP-fronted Node app to which a user can post documents and submit queries. We could pull an interesting corpus into that, e.g. Wikipedia...<br>

</div></div></blockquote></div></div></blockquote><div> </div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="gmail_quote"><div>
<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="gmail_quote"><div>

</div></div></blockquote></div><div>Sure, that sounds great, but for the code writing I think that specific unit tests with predictable answers are more useful to me. The HTTP-fronted Node app looks more like a great &quot;getting started&quot; app, which I&#39;ll add to my todo list.<br>

</div></div></blockquote></div><div><br>Yes, you need unit tests ported from Perl, for sure. The Node app is to test the whole system, evaluate performance, etc<span class="HOEnZb"><font color="#888888"><br><br>Liam<br></font></span></div>
</div>
<br>_______________________________________________<br>
Xapian-devel mailing list<br>
<a href="mailto:Xapian-devel@lists.xapian.org">Xapian-devel@lists.xapian.org</a><br>
<a href="http://lists.xapian.org/mailman/listinfo/xapian-devel" target="_blank">http://lists.xapian.org/mailman/listinfo/xapian-devel</a><br>
<br></blockquote></div><br>