Pregunta

i am looking at plucene for storing a large amount of data and i am very new at this. Each record of the data has a unique ID and 3 more fields. The fields have lots of text but i want just the id to be searchable/indexed so when i provide an id i can retrieve the other fields. A simple example piece of code is this:

my $newIndex = Plucene::Simple->open("data");
$newIndex->add(id1 => {pubmedID => "1223323", title => "a_title", abstract => "an abstract"}); 
my @results = $newIndex->search("1223323");

I am trying to use plucene::simple and I have 2 questions/problems:

  1. i cannot see an option for not indexing some of the fields.
  2. in the @results array I will get 'id1'. How can I get back e.g. the abstract field?

Thanks in advance

¿Fue útil?

Solución

Look at Plucene::Document::Field for setting indexing and storing options. You want to have all 4 fields when indexing, but only 'idl' will be indexed (store the other 3 fields).

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top