|
|||
|
Quote:
I think there is no direct solution for your question. I think you want to save values in a set like MySQL (SET datatype) What you could do is to binary index your data. This causes it's only stored and not searchable, but it is accesable. <? $doc->addField(Zend_Search_Lucene_Field::UnIndexed('mul tiplefield',serialize($yourarray)); ?> Is an example ![]() |
|
|||
|
Quote:
Code:
Document document = new Document();
document.add(new Field("contributor", "s3000xl", Field.Store.NO, Field.Index.TOKENIZED));
document.add(new Field("contributor", "kees", Field.Store.NO, Field.Index.TOKENIZED));
|
|
|||
|
Quote:
Well i'm just a user not a Zend Framework developer but i'm pretty sure this is not covered in the Zend_Search_Lucene api, but what you can do (which depends on your skills) is to make your own field type. Because Zend_Search_Lucene is really extenable you can make your own field type. I did some research for you and i think with some modifications it is possible. When you add a field, the document object just adds an array element to the fields array. Then when you commit a document to the writer, it will send it thro Zend_Search_Lucene_Index_SegmentWriter_DocumentWri ter->addDocument() this function loops al fields and then calls his parent with $this->addField() which is the segmentWriter, there in the addField function the system does some checks if the field already exists, etc.. In the function Zend_Search_Lucene_Index_SegmentWriter_DocumentWri ter->addDocument() it also writes the field, to the index. If you/we know how this is binary done i think we can fix this ![]() By the way isn't storing a "term vector" (vector of terms) not the solution you are looking for? Because i see this: <?php if ($field->storeTermVector) { /** * @todo term vector storing support */ throw new Zend_Search_Lucene_Exception('Store term vector functionality is not supported yet.'); } ?> If feel it as a challenge maybe we can fix this together but i'm not really familair with the binary structure of a Lucene index.Succes! |
|
|||
|
Indeed... more tweeking. Was hoping this would be possible just with the framework as it is. Maybe some Zend framework developers have some ideas too. I'd really like to use the php version of Lucene, but without this feature I may have to look back at the Java one and find a was to bridge to PHP.
|
|
|||
|
Hello,
My search works fine, but i want to get both values of "contributor" out of the result-document. But (in this example) i get only "kees". Are there any news about this problem? Last edited by rahy : 03-04-2008 at 01:39 PM. |
![]() |
| Thread Tools | |
| Display Modes | |
|
|