I'm having trouble getting my index to find the correct hit when I
create longer queries with more information.

I have created an index to store searchable information about various
"facilities", totalling about 5000 in number. Currently, I've done
this using a single "Unstored" field.

The code for this is as follows. Note, I've added a space between each
database field.

$doc = new Zend_Search_Lucene_Document();
$content = $resultset->name.' '.$resultset->street.' '.$resultset-
>city.' '.$resultset->state;
$doc->addField(Zend_Search_Lucene_Field::UnStored('content',
$content));
$doc->addField(Zend_Search_Lucene_Field::UnIndexed('pk', $resultset-
>id));

What I am finding though is that if my search query contains just the
name, for example: "Puckhogs", then I get the desired item returned in
the results.

However, as I add more information to the query I do not get the
result I want in my list of 10 hits, eg: "Puckhogs Ice Centre,
Pickering, Ontario*".

I'm currently letting Zend Lucene analyze my query and construct the
search query itself, as follows:

$query = 'Puckhogs Ice Centre, Pickering, Ontario*';
$hits = self::getSearchIndex()->find($query);

Note that I am including commas in the query above, while the content
field does not contain commas. But I don't think it makes a
difference. Also note that the field above does not contain the street
address, whereas the content field does.

My two questions are:

1) Should I be using an Unstored field here? When I read the Zend
Search manual, I thought this might be my best option.
2) Given a freeform text field from the user, what is my best way of
constructing the query.

Thanks,
Steve
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to