Export to GitHub

solr-php-client - issue #9

Why is there no way to setboost in phpsolrclient?


Posted on Jun 16, 2009 by Happy Horse

If not, how should I approach the method of that in phpsolrclient?

Thanks;

Comment #1

Posted on Jun 16, 2009 by Happy Horse

Why is there no way to setboost in phpsolrclient? If not, how should I approach the method(setboost) in phpsolrclient?

Thanks;

Comment #2

Posted on Jun 16, 2009 by Happy Bird

What type of boost are you trying to set?

The Apache_Solr_Document class contains methods for setting a document level boost as well as individual field boosts. You'll need to use the document class for adding documents to solr that you want boosts on. They should all be listed in the PHPDocs.

.... $document = new Apache_Solr_Document();

// set a boost for the document $document->setBoost(2);

// get the current document boost $document->getBoost();

// add a field with a boost as the last parameter $document->addField("field", "value", 2);

// get a current field's boost $document->getFieldBoost("field");

...

Does this address all your boosting needs?

Comment #3

Posted on Jun 17, 2009 by Happy Bird

Issue 10 has been merged into this issue.

Comment #4

Posted on Jun 17, 2009 by Happy Bird

I've verified that the boost functions I've mentioned exist in the download and not just in trunk source. So I'm considering this a "lack of wiki documentation" issue.

I've documented my comments on the boosting functionality into a new FAQ wiki page:

http://code.google.com/p/solr-php-client/wiki/FAQ#How_do_I_Add_Document_/_Field_Boosts?

Comment #5

Posted on Jun 18, 2009 by Happy Horse

The answer to your expressed thanks, I use the 1.2 version, due to my negligence, resulting in a waste of your time, I am sorry

Status: Done

Labels:
Type-Defect Priority-Medium