<div dir="ltr"><div>Thanks Max - <br></div>please find my comments inline.<br><div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Oct 20, 2016 at 1:21 PM, Max Rydahl Andersen <span dir="ltr"><<a href="mailto:manderse@redhat.com" target="_blank">manderse@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><u></u>




<div>
<div style="font-family:sans-serif"><div style="white-space:normal">
<p dir="auto">Hi Shoubhhik, </p>

<p dir="auto"></p></div>
<div style="white-space:pre-wrap"><span class=""><blockquote style="border-left:2px solid #777;color:#777;margin:0 0 5px;padding-left:5px"><div dir="auto">Hi folks,
</div><div dir="auto">
</div><div dir="auto">Wanted to discuss how the /api/search URL(s) would look like.
</div><div dir="auto">
</div><div dir="auto">To set the scope of the discussion right, I must mention that in this
</div><div dir="auto">sprint we are working on supporting search on ID , URL and full text ( for
</div><div dir="auto">title and description only ) of a workitem.
</div></blockquote><div dir="auto">
</div></span><blockquote style="border-left:2px solid #777;color:#777;margin:0 0 5px;padding-left:5px"><div dir="auto">   1. The ID search is currently only on workitems. ( But in future it
</div><span class=""><div dir="auto">   would be supported for other objects as well. Example, Users,etc. )
</div><div dir="auto">
</div><div dir="auto">   To search by ID --
</div><div dir="auto">
</div></span><div dir="auto">   /api/search/q*=id:4324*
</div><div dir="auto">   This is going to look up the workitem table *only*.
</div><div dir="auto">
</div><div dir="auto">   2.
</div><span class=""><div dir="auto">   To search by URL --
</div><div dir="auto">
</div></span><div dir="auto">   /api/search/q*=url:<a href="http://demo.almighty.io/#/detail/71" style="color:#777" target="_blank">http://<wbr>demo.almighty.io/#/detail/71</a>
</div><div dir="auto">   <<a href="http://demo.almighty.io/#/detail/71" style="color:#777" target="_blank">http://demo.almighty.io/#/<wbr>detail/71</a>>*
</div></blockquote></div>
<div style="white-space:normal">

<p dir="auto">This api seems good for when you explicitly know what key you want to search for.</p>

<p dir="auto">I'm wondering if in the case for the autocomplete/type-ahead context if it would not make sense to a have a "fuzzy" or smart search that will simply do a smart guess of what you are trying to search for. Even do all three searched and sort them by probability ?</p>

<p dir="auto">Examples:</p>

<p dir="auto"><code style="background-color:#f7f7f7;border-radius:3px;margin:0;padding:0 0.4em" bgcolor="#F7F7F7">/api/search/q=4324</code> would return first the items with that exact id and secondly any issues that has text match on that query ?</p>

<p dir="auto"><code style="background-color:#f7f7f7;border-radius:3px;margin:0;padding:0 0.4em" bgcolor="#F7F7F7">/api/search/q=<a href="http://d.a.io/#/71" target="_blank">http://d.a.io/#/<wbr>71</a></code> would return first the items with that exact url id and secondly any issues that has text match (and in future dependency) on that query ?</p></div></div></div></blockquote><div><br></div><div>So the 'smart guess' would either be similar to regex matching and figuring out what to actually search for - <br></div><div>ID / URL. Effectively this would mean adding support for a use case where 'no explicit key (url,id) was provided.<br></div><div><br>What the explicit key specification does is reduce the cost of figuring out what to look for. <br></div><div>Example, in Github whenever we type #SOME_NUMBER , it digs up issues and PRs. To simplify things on the backend, the explicit specification of key would be helpful. So in ALM whenever someone puts #SOME_NUMBER ,the UI fires an Ajax request with the q=id:3235 , thus reduce the cost and complexity of completing the search.<br><br></div><div>Same applies for workitem linking by URL where the search needs to be explicitly by URL.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="font-family:sans-serif"><div style="white-space:normal">

<p dir="auto"></p></div>
<div style="white-space:pre-wrap"><blockquote style="border-left:2px solid #777;color:#777;margin:0 0 5px;padding-left:5px"><div dir="auto">   3.
</div><span class=""><div dir="auto">   Search by ID *AND* URL is not supported.
</div><div dir="auto">   If a q=xxyzz  contains both URL and ID, we only pickup the URL and
</div><div dir="auto">   discard the rest.
</div><div dir="auto">
</div><div dir="auto">   Example.
</div></span><div dir="auto">   /api/search/q=*id:4324*+
</div><div dir="auto">
</div><div dir="auto">*url:<a href="http://demo.almighty.io/#/detail/71" style="color:#777" target="_blank">http://demo.almighty.io/#<wbr>/detail/71</a>
</div><div dir="auto">   <<a href="http://demo.almighty.io/#/detail/71" style="color:#777" target="_blank">http://demo.almighty.io/#/<wbr>detail/71</a>> *is effectively
</div><div dir="auto">
</div><div dir="auto">   /api/search/q=
</div><div dir="auto">
</div><div dir="auto">*url:<a href="http://demo.almighty.io/#/detail/71" style="color:#777" target="_blank">http://demo.almighty.io/#<wbr>/detail/71</a>
</div><div dir="auto">   <<a href="http://demo.almighty.io/#/detail/71" style="color:#777" target="_blank">http://demo.almighty.io/#/<wbr>detail/71</a>> *
</div></blockquote></div>
<div style="white-space:normal">

<p dir="auto">With respect to your #3 I would consider that an empty result since for search terms it is normal to have an explicit <code style="background-color:#f7f7f7;border-radius:3px;margin:0;padding:0 0.4em" bgcolor="#F7F7F7">AND</code> between them. Thus <code style="background-color:#f7f7f7;border-radius:3px;margin:0;padding:0 0.4em" bgcolor="#F7F7F7">q=id:4324 url:<a href="http://demo.almighty.io/#/detail/71" target="_blank">http://demo.almighty.io/#/<wbr>detail/71</a></code> means it needs to match both terms which by definition is impossible - thus empty result.<br><br></p></div></div></div></blockquote><div>Good idea. Agreed.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="font-family:sans-serif"><div style="white-space:normal"><p dir="auto"></p>

<p dir="auto"></p></div>
<div style="white-space:pre-wrap"><blockquote style="border-left:2px solid #777;color:#777;margin:0 0 5px;padding-left:5px"><div dir="auto">   4.
</div><span class=""><div dir="auto">   Free text search is supported only on workitem title and description
</div><div dir="auto">
</div></span><div dir="auto">   /api/search/q:=*title:some title substring*+
</div><div dir="auto">*description:some description substring *
</div></blockquote></div>
<div style="white-space:normal">

<p dir="auto">Again, great if we can search on specific fields, but I would think we would want a higher level search that is "smart" about searching across various fields rather than explicit.</p>

<p dir="auto">With respect to what field names we use - are these fields the "system" names or the field names that are on the type ? I reckon in the long run we need both ? </p></div></div></div></blockquote><div><br></div><div>I meant <b>system.title </b>, sorry for the confusion :)<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="font-family:sans-serif"><div style="white-space:normal">

<p dir="auto"></p></div>
<div style="white-space:pre-wrap"><blockquote style="border-left:2px solid #777;color:#777;margin:0 0 5px;padding-left:5px"><div dir="auto">5.
</div><span class=""><div dir="auto">   The delimiter for multiple clauses ( we shall support "AND" now ) will
</div><div dir="auto">   be "+" . ( inspired from Github ) as already used above. We need to
</div><div dir="auto">   consider situations where the string itself contains a "+" by escaping them
</div><div dir="auto">   properly.
</div></span></blockquote></div>
<div style="white-space:normal">

<p dir="auto">+1</p>

<p dir="auto"></p></div>
<div style="white-space:pre-wrap"><blockquote style="border-left:2px solid #777;color:#777;margin:0 0 5px;padding-left:5px"><div dir="auto">   6. if the search query contains a mix of ID, URL , title,description :
</div><span class=""><div dir="auto">   The order in which we are going to look for fields to make a decision on
</div><div dir="auto">   the search is:
</div><div dir="auto">
</div><div dir="auto">   1. URL
</div><div dir="auto">   2. ID
</div><div dir="auto">   3. title and description ( for free text search )
</div></span></blockquote></div>
<div style="white-space:normal">

<p dir="auto">explicit AND is my expectation. No magic ordering in this.</p></div></div></div></blockquote><div><br></div><div>Actually, some stuff here is mutually exclusive. Just like #3 , this should return an empty result because it would make no sense for URL and ID to co-exist in the search query.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="font-family:sans-serif"><div style="white-space:normal">

<p dir="auto">/max</p>

<p dir="auto"></p></div><span class="">
<div style="white-space:pre-wrap"><blockquote style="border-left:2px solid #777;color:#777;margin:0 0 5px;padding-left:5px"><div dir="auto">   Let me know your thoughts :)
</div><div dir="auto">
</div><div dir="auto">   -
</div><div dir="auto">   Shoubhik
</div></blockquote></div>
</span><div style="white-space:normal">

<p dir="auto">/max<br>
<a href="http://about.me/maxandersen" style="color:#3983c4" target="_blank">http://about.me/maxandersen</a></p>
</div>
</div>
</div>

</blockquote></div><br></div></div></div></div></div>