Results 1 to 5 of 5
  1. #1
    djgovins is offline Member
    Join Date
    Jun 2011
    Location
    India
    Posts
    10
    Rep Power
    0

    Default Indexing an associative array

    I want to index an associative array which is as shown below

    A=10238121
    B=4700-12-31
    C=123
    D=ear

    where A,B,C,D are keys with their respective values.

    Now there are 2 approaches towards indexing it,

    Approach 1
    --------------
    In a Lucene document, I create 2 fields with names "key" and "values" and I index A,B,C,D into "key" and their corresponding values into "values" field.

    Approach 2
    --------------
    In a Lucene document, I create 4 fields with their names as A,B,C,D and their values as 10238121,...,ear.

    Which approach of these two should be used. Will difference in approach affect the search results ?

  2. #2
    Petr's Avatar
    Petr is offline Senior Member
    Join Date
    Jan 2011
    Location
    Russia
    Posts
    620
    Rep Power
    4

    Default

    Hi.
    You didn't point about your model. Is that data one model or that is difference data.
    I.e. if you use first approach you will make four difference Documents. But in second approach you will use only one Document.
    Of course for search faster will be second approach. But I can't say exactly, because I don't know your architecture.
    Skype: petrarsentev
    http://TrackStudio.com

  3. #3
    djgovins is offline Member
    Join Date
    Jun 2011
    Location
    India
    Posts
    10
    Rep Power
    0

    Default

    I didn't get you regarding the model I'm using.

    Does it mean what I'm indexing and searching on ?

  4. #4
    Petr's Avatar
    Petr is offline Senior Member
    Join Date
    Jan 2011
    Location
    Russia
    Posts
    620
    Rep Power
    4

    Default

    I'm sorry I don't understand you.
    You asked about performance Lucene for two approaches in create index.
    I answered that second approach faster then first.
    Skype: petrarsentev
    http://TrackStudio.com

  5. #5
    djgovins is offline Member
    Join Date
    Jun 2011
    Location
    India
    Posts
    10
    Rep Power
    0

Similar Threads

  1. html indexing
    By adbawany in forum Lucene
    Replies: 0
    Last Post: 01-22-2011, 03:23 PM
  2. re-indexing particular fields
    By caballo7 in forum Lucene
    Replies: 0
    Last Post: 06-08-2010, 06:46 AM
  3. Indexing XML using lucene
    By peliukasss in forum Lucene
    Replies: 0
    Last Post: 03-28-2010, 10:20 PM
  4. [SOLVED] indexing an element in an array help!
    By anthonym2121 in forum New To Java
    Replies: 1
    Last Post: 04-03-2009, 06:21 PM
  5. Associative Arrays
    By mayhewj7 in forum New To Java
    Replies: 2
    Last Post: 02-28-2009, 09:32 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •