Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 359766

Summary: [Search]Server does not give back result on wild card *.
Product: [ECD] Orion Reporter: libing wang <libingw>
Component: ServerAssignee: John Arthorne <john.arthorne>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: john.arthorne, susan
Version: unspecified   
Target Milestone: 0.4 M1   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Bug Depends on:    
Bug Blocks: 359739, 361449    

Description libing wang CLA 2011-10-03 16:37:12 EDT
I was thinking about the way to fix Bug 359739. I enable the "?" and "*" on client side to see what respond server will give back.
I changed line 87 in searchClient.js to :
return searchLocation + this._luceneEscape(query, true);

I input "Search*Model" in order to find string "SearchResultModel" in searchExplorer.js. But server does not give back the file. But if I use "search*model", which is all lower case, the file is returned.

You will still see 0 match on the file but that is because the inside file search is not fixed yet with reg ex.
Comment 1 libing wang CLA 2011-10-06 16:06:14 EDT
Another thing I found today :
If I use "search\*model" as the search request, which means "*" is treated as literal, I still get the result from server. This makes no way for the in-file search to match it because there is no such thing "search*model".
Comment 2 John Arthorne CLA 2011-10-07 09:58:40 EDT
We're not planning to support wildcards in 0.3 so I will look at this for 0.4.
Comment 4 John Arthorne CLA 2011-10-31 16:55:51 EDT
Unfortunately it looks like Solr doesn't support this, so we might have to do something manual.

https://issues.apache.org/jira/browse/SOLR-219
Comment 5 libing wang CLA 2011-11-01 10:50:08 EDT
(In reply to comment #4)
> Unfortunately it looks like Solr doesn't support this, so we might have to do
> something manual.
> 
> https://issues.apache.org/jira/browse/SOLR-219

I see. If the issue is only because of the lower-case, we can always use lower case in wild card and pass to Lucene. E.g. Search*Model ===> search*model.
Also, we will never treat "*" as string literal as long as we turn wild card on.
Comment 6 John Arthorne CLA 2011-11-01 10:53:13 EDT
(In reply to comment #5)
> I see. If the issue is only because of the lower-case, we can always use lower
> case in wild card and pass to Lucene. E.g. Search*Model ===> search*model.
> Also, we will never treat "*" as string literal as long as we turn wild card
> on.

I can do this workaround on the server. I don't want the client to worry about solr bugs like this.
Comment 9 libing wang CLA 2011-11-02 14:10:04 EDT
(In reply to comment #8)
> That fix wasn't quite right:
> 
> http://git.eclipse.org/c/orion/org.eclipse.orion.server.git/commit/?id=f35a7e415b9da86c08f31afb486adefb0c38f814

Just verified with the latest code, it was fixed.
Another question :
No matter it is wild card or literal search, we only support whole word, right ?
"Search*Model" gave me result but "Search*" didn't.
Comment 10 John Arthorne CLA 2011-11-03 15:06:03 EDT
(In reply to comment #9)
> Another question :
> No matter it is wild card or literal search, we only support whole word, right
> ?
> "Search*Model" gave me result but "Search*" didn't.

Talked to Libing about this offline. Search* will work. The problem in this particular case is the server only returns the first N results, and the match Libing was looking for was not in that list. We need to add pagination to search so we can see all results. Entered bug 362827.
Comment 11 libing wang CLA 2011-11-03 16:33:43 EDT
(In reply to comment #10)
> (In reply to comment #9)
> > Another question :
> > No matter it is wild card or literal search, we only support whole word, right
> > ?
> > "Search*Model" gave me result but "Search*" didn't.
> 
> Talked to Libing about this offline. Search* will work. The problem in this
> particular case is the server only returns the first N results, and the match
> Libing was looking for was not in that list. We need to add pagination to
> search so we can see all results. Entered bug 362827.

Yes, I also verified that if I use "searchResult*" it gave me back the result.
I think if we resolve bug 362827 and the corresponding UI bugs, global search will be more usable with wild card search.