Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [recommenders-dev] Fwd: [Bug 383511] Enable Gerrit for recommenders.incubator/org.eclipse.recommenders.codesearch.git

Good news!
I got it working and hopefully I did it in the proper way :)

I guess you introduced a new document type, right?
Exactly, there's a new doc type "_expression_". Are you aware of any tool for eclipse to query and navigate a lucene index? Currently I'm using a java swing app called "Luke", it's just fine for my needs, bu I was wondering if there's something to be used inside eclipse. 

Please check org.eclipse.recommenders.codesearch.rcp.index.indexer.CodeIndexer.delete(File) which determines which documents need to be deleted based on a field called Fields.RESOURCE_PATH stored inside the documents. Does adding this field solve your issue?
You're right, I missed exactly that field! Actually at the moment I think it's easy to miss something in extending the index since you have to pay attention  to make the various indexers aware of the new one by directly extending it, maybe there's a more generic way to achieve the same result.

Not sure I understand your context. Actually, I’m sure. I don’t understand ;)
Whats your setup? How many plugins and which ones do you build. Don't you “just" include your changes into your copy of the indexer plugin?
Well actually it wasn't really clear even in my mind :D but I think I got the point now: basically I just copied the indexer plugin under my repo and changed its pom accordingly... Is it the right way to proceed? The only doubt I have now is how to merge the changes from the official indexer plugin when it gets modified.

From a feature perspective: the good news are that I finally have a working index for the expressions, the next thing I have to do is to think about a generic way to store them. Currently I'm storing the _expression_ string but it's far from being the proper solution since I need to store a meaningful string that can be easily aggregated during search... I'm thinking about an example like:

Widget foo1;
Widget foo2;
Display d1 = foo1.getDisplay();
Display d2 = foo2.getDisplay();

Currently, for the previous snippet, I'm storing the _expression_ as-is for both Display assignments, while I should be storing something like [localVariable:org.eclipse.Widget].getDisplay(), or even additional information for the method call.

Let me know what you think,
Massimo.

Back to the top