<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/xhtml; charset=utf-8">
</head>
<body>
<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"><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><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><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><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><div dir="auto">   To search by URL --
</div><div dir="auto">
</div><div dir="auto">   /api/search/q*=url:<a href="http://demo.almighty.io/#/detail/71" style="color:#777">http://demo.almighty.io/#/detail/71</a>
</div><div dir="auto">   <<a href="http://demo.almighty.io/#/detail/71" style="color:#777">http://demo.almighty.io/#/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=http://d.a.io/#/71</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>

<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><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><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">http://demo.almighty.io/#/detail/71</a>
</div><div dir="auto">   <<a href="http://demo.almighty.io/#/detail/71" style="color:#777">http://demo.almighty.io/#/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">http://demo.almighty.io/#/detail/71</a>
</div><div dir="auto">   <<a href="http://demo.almighty.io/#/detail/71" style="color:#777">http://demo.almighty.io/#/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:http://demo.almighty.io/#/detail/71</code> means it needs to match both terms which by definition is impossible - thus empty result.</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><div dir="auto">   Free text search is supported only on workitem title and description
</div><div dir="auto">
</div><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>

<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><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></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><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></blockquote></div>
<div style="white-space:normal">

<p dir="auto">explicit AND is my expectation. No magic ordering in this.</p>

<p dir="auto">/max</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">   Let me know your thoughts :)
</div><div dir="auto">
</div><div dir="auto">   -
</div><div dir="auto">   Shoubhik
</div></blockquote></div>
<div style="white-space:normal">

<p dir="auto">/max<br>
<a href="http://about.me/maxandersen" style="color:#3983C4">http://about.me/maxandersen</a></p>
</div>
</div>
</body>
</html>