<p dir="ltr">Oops, this was suppose to go to the list</p>
<div class="gmail_quote">---------- Forwarded message ----------<br>From: "Aslak Knutsen" <<a href="mailto:aslak@redhat.com">aslak@redhat.com</a>><br>Date: Oct 20, 2016 14:07<br>Subject: Re: How would the 'search' URLs look like for the ALM Search service ?<br>To: "Shoubhik Bose" <<a href="mailto:shbose@redhat.com">shbose@redhat.com</a>><br>Cc: <br><br type="attribution"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Oct 20, 2016 at 12:32 PM, Shoubhik Bose <span dir="ltr"><<a href="mailto:shbose@redhat.com" target="_blank">shbose@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Thanks Aslak --<br></div><div>Please find my comments inline:<br></div><div><div class="gmail_extra"><br><div class="gmail_quote"><span class="m_4783853923044927387gmail-">On Thu, Oct 20, 2016 at 3:14 PM, Aslak Knutsen <span dir="ltr"><<a href="mailto:aslak@redhat.com" target="_blank">aslak@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><span class="m_4783853923044927387gmail-m_-2285455746153101363gmail-">On Thu, Oct 20, 2016 at 9:23 AM, Shoubhik Bose <span dir="ltr"><<a href="mailto:shbose@redhat.com" target="_blank">shbose@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div><div>Hi folks,<br></div><br>Wanted to discuss how the /api/search URL(s) would look like.<br><br></div>To set the scope of the discussion right, I must mention that in this sprint we are working on supporting search on ID , URL and full text ( for title and description only ) of a workitem.<br><br><br></div><div><ol><li>The ID search is currently only on workitems. ( But in future it would be supported for other objects as well. Example, Users,etc. )<br><br>To search by ID --<br><br>/api/search/q<b>=id:4324</b>  <br>This is going to look up the workitem table <b>only</b>. <br><br></li></ol></div></div></blockquote><div><br></div></span><div>I would remove the need for "id:". It's fine to support a direct field search, but it shouldn't be required.</div><div><br></div><div>Any object can have a "id", so it can't 'just' look in workitem table, even tho that is the only supported for now.</div></div></div></div></blockquote><div><br><br></div></span><div>If I'm doing an ID lookup, should I be doing a /api/search/q=20596  ?<br></div></div></div></div></div></blockquote><div><br></div><div>Yes. It's fine to support "id:20596" and "20596" but both should 'at least' find the Object with id 20596(the non direct field search could find more as 20596 could match some text somewhere as well).</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div class="gmail_extra"><div class="gmail_quote"><div></div><span class="m_4783853923044927387gmail-"><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class="m_4783853923044927387gmail-m_-2285455746153101363gmail-"><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><ol><li><br></li><li><br>To search by URL --<br><br>/api/search/q<b>=url:<a href="http://demo.almighty.io/#/detail/71" target="_blank">http://demo.<wbr>almighty.io/#/detail/71</a></b>  <br><br></li></ol></div></div></blockquote><div><br></div></span><div>I would remove the need for "url:". It's fine to support a direct field search, but it shouldn't be required.<br></div><span class="m_4783853923044927387gmail-m_-2285455746153101363gmail-"><div> </div></span></div></div></div></blockquote></span><div><br>If I'm doing a URL lookup, should I be doing a /api/search/q=<span class="m_4783853923044927387gmail-m_-2285455746153101363gmail-"><b><a href="http://demo" target="_blank">http://demo</a>.<a href="http://almighty.io/#/detail/71" target="_blank">almi<wbr>ghty.io/#/detail/71</a></b>  </span>  ?<br> </div></div></div></div></div></blockquote><div><br></div><div>Yes</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div class="gmail_extra"><div class="gmail_quote"><span class="m_4783853923044927387gmail-"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class="m_4783853923044927387gmail-m_-2285455746153101363gmail-"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><ol><li><br><br></li><li><br>Search by ID *AND* URL is not supported.<br>If a q=xxyzz  contains both URL and ID, we only pickup the URL and discard the rest.<br><br>Example.<br>/api/search/q=<b>id:4324</b>+<b>url:<a href="http://demo.almighty.io/#/detail/71" target="_blank">http<wbr>://demo.almighty.io/#/detail/7<wbr>1</a><br><br></b>is effectively<br><br><b> </b>/api/search/q=<b>url:<a href="http://demo.almighty.io/#/detail/71" target="_blank">http://demo.<wbr>almighty.io/#/detail/71</a><br><br><br></b></li></ol></div></div></blockquote></span><div>Perosnally I wouldn't ignore any fields, I would rather return no result. There is no 'Object' with id 4324 and URL x.</div><div><br></div><div>e.g. this JPQL is perfectly legal, it just doesn't return anything:</div><div><br></div><div>issue = "ARQ-100" AND issue = "ARQ-200"<br></div><span class="m_4783853923044927387gmail-m_-2285455746153101363gmail-"><div> </div></span></div></div></div></blockquote><div><br></div></span><div>Got it , makes sense.<br></div><span class="m_4783853923044927387gmail-"><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class="m_4783853923044927387gmail-m_-2285455746153101363gmail-"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><ol><li><b></b></li><li><br>Free text search is supported only on workitem title and description<br><br>/api/search/q:=<b>title:some title substring</b>+<b>description:some description substring</b></li></ol></div></div></blockquote><div><br></div></span><div>I would remove the need for "title:" and "description:". It's fine to support a direct field search, but it shouldn't be required.</div><div><br></div><div>I would expect "some title substring some description substring" to end up as a search like:</div><div><br></div><div>*some* AND *title* AND *substring* AND *description" -> search across all available fields for all objects</div><span class="m_4783853923044927387gmail-m_-2285455746153101363gmail-"><div> </div></span></div></div></div></blockquote><div><br><br></div></span><div>If I'm doing a search as<br><br>/api/search/q=20596 my_title my_description <a href="http://some_url" target="_blank">http://some_url</a> <br></div><div>( here the spaces are AND )<br><br></div><div>As per your below comment on delimiters,<br><br></div><div>We get the following tokens:<br><br>1. 20596<br></div><div>2. my_title<br></div><div>3. my_description<br></div><div>4. <a href="http://some_url" target="_blank">http://some_url</a><br></div><div><br></div><div>How would you recommend the search to go on from here?<br><br></div><span class="m_4783853923044927387gmail-"><div><br></div></span></div></div></div></div></blockquote><div><br></div><div><br></div><div>That is a very good question. </div><div><br></div><div>1. We can detect that this 'might' be an ID  (ref 5.)</div><div>4. We can detect this is a known URL and extract the ID (ref 6.)</div><div><br></div><div><br></div><div>1. 2. and 3. are random pices of text, while 5. and 6. might be ID.</div><div><br></div><div>I think we can start of with the assumption that the user want to find '1.-6. somewhere in the docuemnt, but not nessesarly in the same 'field''.</div><div><br></div><div>Assuming we have a document with </div><div><br></div><div>{</div><div>  id: 20596,</div><div>  title: "Label identification pattern",</div><div>  description: "As a User I want to have the labels / tags configured with a predefined set of colors and options"</div><div>}</div><div><br></div><div><br></div><div>I would expect a query like: "20596 label user <a href="http://some_url/20596" target="_blank">http://some_url/20596</a>" to find that document.</div><div>(note, the complete doc match the complete query but the individual fields do not match the complete query)</div><div><br></div><div><br></div><div>I would expect match on: "20596"<br></div><div>I would expect match on: "user label"<br></div><div>I would expect match on: "<a href="http://demo.almighty.io/20596" target="_blank">http://demo.almighty.io/20596</a><wbr>"<br></div><div>I would expect match on: "labels users"<br></div><div> <br></div><div>I would not expect match on: "20595 <a href="http://demo.almighty.io/20596" target="_blank">http://demo.almighty.io/20596</a>" (assuming 20595 doesn't mention <a href="http://demo.almighty.io/20596" target="_blank">http://demo.almighty.io/20596</a> <wbr>as text somewhere)</div><div><br></div><div>I would not expect match on: "user label authentication"<br></div><div><br></div><div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div class="gmail_extra"><div class="gmail_quote"><span class="m_4783853923044927387gmail-"><div></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class="m_4783853923044927387gmail-m_-2285455746153101363gmail-"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><ol><li><br><b><br></b></li><li><br>The delimiter for multiple clauses ( we shall support "AND" now ) will be "+" . ( inspired from Github ) as already used above. We need to consider situations where the string itself contains a "+" by escaping them properly.<br><br></li></ol></div></div></blockquote></span><div>I think tokenized on 'space' and use that as AND would work for now.</div><span class="m_4783853923044927387gmail-m_-2285455746153101363gmail-"><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><ol><li><br></li><li>if the search query contains a mix of ID, URL , title,description :<br>The order in which we are going to look for fields to make a decision on the search is:<br><br>1. URL<br>2. ID <br>3. title and description ( for free text search )<br><br><br></li></ol></div></div></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><ol><li><br><br>Let me know your thoughts :)<br><br><br>-<br>Shoubhik<br><br><br></li></ol></div></div>
</blockquote></span></div><span class="m_4783853923044927387gmail-m_-2285455746153101363gmail-HOEnZb"><font color="#888888"><br></font></span></div><span class="m_4783853923044927387gmail-m_-2285455746153101363gmail-HOEnZb"><font color="#888888"><div class="gmail_extra"><br></div><div class="gmail_extra">-aslak-</div></font></span></div>
</blockquote></span></div><br><br>---<br></div><div class="gmail_extra">Shoubhik<br></div></div></div>
</blockquote></div><br></div></div>
</div>