Hi, first, the basic idea, that underlies alls lucene data is still the same: You create a "document", add key-value pairs to it and let the indexer do its magic. When it is done, you can query the index.
Yes we need to move to a newer version of lucene in the core indexer and it is a problem, that the module exposed lucene internals and some queries will be hard to adapt, but it is IMHO doable. For normal queries and usage the Parsing and Indexing API IMHO works. I think CSS indexer might be approachable, although it carries additional complexity cause it handles embedding into HTML. - The indexer is in css.editor and implemented in org.netbeans.modules.css.indexing.CssIndexer. It is created by an embedded factory, which is registered in the layer file in Editors/text/css. - CssIndexer#index is called by the Parsing and Indexing infrastructure for each recognized document and when the parsing result is available - the #index method extracts the IDs, classes, html elements and clors from the CSS parser and stores that in the documet - The document is then stored using the Indexing Support If you now want to now where inside the project a certain CSS class is used, you use the convenience function findClasses in org.netbeans.modules.css.indexing.api.CssIndex. This method builds the query and dispatches it to the QuerySupport. It will return the FileObjects, that hold the corresponding classes. There are dark parts in the API, but the basic usage is ok. HTH Matthias Am Samstag, dem 13.05.2023 um 17:14 -0700 schrieb Laszlo Kishalmi: > Dear all, > > Does anyone have a good knowledge on our Indexing API? > > I would like to add some search functionality to my HCL/Terraform support. > > I do not know too much of Lucene, but what I know is not really match > with what I see there. Then I checked and we are using Lucene 3.6.2, > that is more than 10 years old by now. > > I've also checked what would it mean to upgrade that to a recent > version. It seems to be a hard job to take, moving even to Lucene 4.x > would be hard, at least with my level of knowledge. (Lucene changed > completely between 3.x to 4.x) > > I've seen that the new Maven Indexer comes with Lucene 9.x. So we have > recent Library support. > > My first question, shall we start to do something about the old Lucene? > > Shall I invest using our current indexing API? > What I'm leaning for at the moment is, to move the Lucene 9.x library > out of Maven Indexer as a separate library project then I'd implement my > things using Lucene 9 directly. > > What do you think on that? --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected] For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
