Lucene - Core
  1. Lucene - Core
  2. LUCENE-3865

MemoryIndex does not allow user to add multiple values for a single field name

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Duplicate
    • Affects Version/s: 3.5
    • Fix Version/s: 4.1, 5.0
    • Component/s: modules/other
    • Labels:
      None
    • Environment:

      All

    • Lucene Fields:
      New

      Description

      When using MemoryIndex.addField the following operation throws an IllegalArgumentException:

      index.addField("foobar", "value1", LuceneAnalyzer);
      index.addField("foobar", "value2", LuceneAnalyzer);

      This throws:
      java.lang.IllegalArgumentException: field must not be added more than once

      According to Uwe Schindler on the java-user mailing list this violates the IndexWriter/IndexReader contract.

        Issue Links

          Activity

          Hide
          Uwe Schindler added a comment -

          Closed after release.

          Show
          Uwe Schindler added a comment - Closed after release.
          Hide
          Simon Willnauer added a comment -

          included in LUCENE-4515

          Show
          Simon Willnauer added a comment - included in LUCENE-4515
          Hide
          Ashwin Jayaprakash added a comment - - edited

          An option to delete fields would also be useful.

          Does this mean that RAMDirectory is still alright to use for small data sets?

          Show
          Ashwin Jayaprakash added a comment - - edited An option to delete fields would also be useful. Does this mean that RAMDirectory is still alright to use for small data sets?
          Hide
          Jasper van Veghel added a comment -

          Is MemoryIndex still a relevant way of doing Prospective Search? I see a couple of other issues that talk about using a regular IndexWriter with a MemoryCodec.

          I myself am also looking for a way to do Prospective Search — I'd like to push documents into both Apache Solr (general search) and something like MemoryIndex (for alerting a large number of users instantly.) I've implemented it to the point where I have a Solr IndexSchema to provide me with the same Analyzers as the ones the Apache Solr instance has, but now I'm running into the issue that MemoryIndex does not support multiple fields and only supports String-valued elements (less of an issue than the lack of multiple-field support) .. Should I make an effort to try and add multiple-field support to MemoryIndex or should I look towards another way of achieving the same?

          Show
          Jasper van Veghel added a comment - Is MemoryIndex still a relevant way of doing Prospective Search? I see a couple of other issues that talk about using a regular IndexWriter with a MemoryCodec. I myself am also looking for a way to do Prospective Search — I'd like to push documents into both Apache Solr (general search) and something like MemoryIndex (for alerting a large number of users instantly.) I've implemented it to the point where I have a Solr IndexSchema to provide me with the same Analyzers as the ones the Apache Solr instance has, but now I'm running into the issue that MemoryIndex does not support multiple fields and only supports String-valued elements (less of an issue than the lack of multiple-field support) .. Should I make an effort to try and add multiple-field support to MemoryIndex or should I look towards another way of achieving the same?
          Hide
          Uwe Schindler added a comment -

          Thanks for opening this, I will have a look into this. If I am able to fix this easily, I will assign myself!

          Show
          Uwe Schindler added a comment - Thanks for opening this, I will have a look into this. If I am able to fix this easily, I will assign myself!

            People

            • Assignee:
              Simon Willnauer
              Reporter:
              Dave Seltzer
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 1h
                1h
                Remaining:
                Remaining Estimate - 1h
                1h
                Logged:
                Time Spent - Not Specified
                Not Specified

                  Development