[support] Index reset for a multi-value field in SOLR

Kamal Palei palei.kamal at gmail.com
Tue Jun 25 10:57:22 UTC 2013


Many times I have observed when there is a query regarding drupal and
apachesolr, the drupal mailing list is almost silent. If it is only drupal
fine, we can do R&D, lot of books, mailing list support, we can get some
insight. If it is only solr, still we can get help from books, mailing
lists etc and can proceed.

When it comes to drupal and apachesolr I do not see any good book, not much
help from mailing list.., its almost simple issues takes very long time to
resolve.

Various search options, I could not get it done through apachesolr module,
end up writing custom code to do complex searches (like get the documents
having mandatory keyword1, keyword2, keyword3 AND optional keywords
keyword4, keyword5, keyword6 and NOT HAVING keyword keyword7, keyword8 and
much more....)

Still now I was doing indexing part using apache solr, Now I have a
requirement, how do we reset the value of a multi-value field in index. I
am sure, this can be done with few lines of code, but we do not have
relevant document, or less users work on it  or whatever reason it is
definitely a pain point....

I request, somebody good at apachesolr module probably write a good book
and put in packt publish or amazon.., atleast we will have some reference
book where can get sample example codes.. ,

Best Regards
Kamal
Net Cloud Systems
Bangalore



On Mon, Jun 24, 2013 at 7:18 PM, Kamal Palei <palei.kamal at gmail.com> wrote:

> Dear All
> I have added a multi value field in schema file (say skillset). In my
> *_apachesolr_index_document_build* hook,   I get all the values of field
> and do  add to $document using addField api. With this values are indexed
> and I can search, I get the search result perfect.
>
> Just for example purpose, say field name is *skillset* (it's a multi
> value field).
>
> Say initially I added, Java, PHP, MySQL, Drupal, C++ as skill sets to
> skillset field as separate separate values.
>
> If I search for PHP + MySQL + C++, I get this document. So far so good.
>
> Say after 1 month, user came and removed C++ skill set. Then in index, for
> skillset field the corresponding change should happen. That is first all
> old values should be removed, next Java, PHP, MySQL, Drupal should added
> only.
>
> Today I do not know how to remove a field's old values, Can somebody help
> me to find out how do I remove old datas for that particular field
> (skillset). Today what is happening, I go and add again. Now the resultant
> data for skillset becomes Java, PHP, MySQL, Drupal, C++, ava, PHP, MySQL,
> Drupal. Hence if I search c++, I get this document in search which is wrong.
>
> Please somebody help me or give me pointer how to delete the old data for
> a field in index.
>
> Please note that in case of single-value field this issue would not arsie.
>
> Thanks
> kamal
> Net Cloud Systems
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/support/attachments/20130625/e5a3a5ef/attachment.html 


More information about the support mailing list