Errors in Search
2012/01/04 (347 words)

EDIT – This has now been resolved. All the below searches should work correctly, with the exception of XCompositeGetOverlayWindow. I am adding that to the index to be refreshed sometime in the next month or so.

Well thanks to some sample searches being thrown against the codesearch index I can finally start tuning issues that have cropped up. The main issue I have currently is searches returning no results where you would expect some. Some examples are included below.

[/*A/ ext:java][1]

[/sql.append.*se/ ext:java][2]


[/*AsyncCallback/ ext:java][4]


Most of the problems I found were during my outage window which is good to discover. With the exception of the last query above which returns nothing due to the index not having indexed (yet) all issues are due to a undiscovered bug.

Take the following example,


The problem is the way which I interpreted the regex. Essentially on the back-end a lot of the regex is expanded out fully for a certain amount of cases and a list of matches are generated. This is to ensure that it can run quickly. Think of it as precaching every possible regex against all lines in all the files. The problem in this case is that I have a unit test case missing. I never included a test which matched the above and because of this there is a bug in the way that is expanded out to match everything. A modified version of the above which does return results is,

[/memcpy.* sizeof/][6]

The above query returns results as would be expected. In fact all of the ones above can be rewritten to work correctly. Such as the below,

[/* A/ ext:java][7]

[/sql.append.* se/ ext:java][8]

[/memcpy.* sizeof/][6]

[/* AsyncCallback/ ext:java][9]

If you try the above queries you will see they act as expected. I will be updating code shortly to take this case into consideration, and of course post an update here.

[1]: ext:java [2]: ext:java [3]: [4]: ext:java [5]: [6]: sizeof/ [7]: A/ ext:java [8]: se/ ext:java [9]: AsyncCallback/ ext:java