This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 168822 - access to Indexer storage
Summary: access to Indexer storage
Alias: None
Product: editor
Classification: Unclassified
Component: Parsing & Indexing (show other bugs)
Version: 6.x
Hardware: Sun All
: P2 blocker (vote)
Assignee: Tomas Zezula
Depends on: 190872
  Show dependency tree
Reported: 2009-07-20 15:19 UTC by Vladimir Voskresensky
Modified: 2010-12-03 06:16 UTC (History)
2 users (show)

See Also:
Exception Reporter:


Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Voskresensky 2009-07-20 15:19:55 UTC
CND doesn't plan to move on Indexing&&Parsing API in 6.8 timeframe, but we'd like to reuse Lucene index infrastructure.
We are responsible for all modifications checks and so on and only need the place where to store our index.
Our usages could be like:
1) fill in
- get indexer
- ask indexer to return IndexDocument for doc_id
- put (key, value) into IndexDocument

2) query
- ask indexer for IndexResult based on doc_id
- query IndexResult for own needs

3) on modification:
- invalidate/remove index data for doc_id
Comment 1 David Strupl 2010-01-18 07:45:07 UTC
Tomasi, please evaluate. It's coming from the cnd team (see the whiteboard field).
Comment 2 Tomas Zezula 2010-01-18 10:18:47 UTC
There are several possible levels of the support.
1) The lowest - the lucene library is included in the IDE cluster and can be already used, but this does not index reopening, everyone will need to solve the merges, queries himself. This is the case used by java, parsingapi which copies the LuceneIndex class and shares some helpers using implementation dependency.
2) A new low level indexing API should be created (used by parsingapi, java, cnd). This API will be the "low level API". It will provide something like parsingapi's IndexSupport and QuerySupport (without dependency on parsingapi). The implementation part will contain the classes shared in java and parsingapi. The java index is not very generic because of performance. It's question how it will be slowed down by using Document instances rather than Strings. But some kind of convertor can be used to solve this problem.
Something like:

public class LuceneIndex<T> {
    public LuceneIndex(final StoreConvertor<? super T> convertor) {...}
    public add(T data) {....}

public final class IndexingSupport {
    public static LuceneIndex<Document> createSimpleIndex() {...}
    public static <T> LuceneIndex<T> createIndex(final StoreConvertor<? super T> convertor){...}
Comment 3 Vitezslav Stejskal 2010-01-19 01:54:55 UTC
I personally vote against working on this in 6.9. It will require a considerable amount of time; it's potentially harmful for java indexing; it's not a user visible feature and it does not even really improve the current state (except maybe for cnd).
Comment 4 Vladimir Voskresensky 2010-01-19 04:16:46 UTC
Hi Vita, Tomas,
We don't need access to LuceneIndex, we need only access to dedicated storage (IndexImpl?) and are responsible for tracking all modifications ourselves.

Request is to give us access for the following usage:

is = IndexingSupport.getInstance("cnd")
doc = is.createDocument(fo);
doc.addPair(a, b);

later on to query:
q = QuerySupport.for("cnd");
indexResults = q.query(c, d, e, f);

All is in place, except the create/access pair:

Does it simplify things?

Comment 5 Tomas Zezula 2010-10-14 15:16:29 UTC
The low level apis were integrated.
The low level api allows to store and query user objects.
The API is low level as the user needs to provide Convertors from user type to lucene's Document (Query).
It's quite easy but the Document based API does not need it.
Comment 6 Tomas Zezula 2010-11-29 17:17:48 UTC
Implemented by Lucene Parsing Support on low level (used by parsing.api and java).
I will now create the "parsing api" like level for simpler usage.
Comment 7 Tomas Zezula 2010-12-01 12:39:00 UTC
Fixed jet-main 133f43f39712
Comment 8 Quality Engineering 2010-12-03 06:16:27 UTC
Integrated into 'main-golden', will be available in build *201012030001* on (upload may still be in progress)
User: Tomas Zezula <>
Log: #168822:access to Indexer storage