Giter VIP home page Giter VIP logo

Comments (13)

GoogleCodeExporter avatar GoogleCodeExporter commented on September 26, 2024
Whoops...just noticed that I was examining the $results->response instead of 
just $results for something with the highlighting on it, and that's why I was 
not finding it.  Oh well, I still find that change useful for myself, so I'll 
keep it.

Original comment by [email protected] on 5 Jul 2010 at 6:55

from solr-php-client.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 26, 2024
I could see something like this being useful for simpler access to 
highlighting, however there are some gotchas that would need to be worked out:

 * not everyone uses the name "id" for their uniquely identifying field - personally I use "guid" - so that would need to be configurable.

 * I would want to set and get the highlighting similar to how boosts are handled so that its not considered just another document key / value(s) pair

Original comment by [email protected] on 8 Jul 2010 at 10:51

from solr-php-client.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 26, 2024
Changing to an acknowledged enhancement request

Original comment by [email protected] on 8 Jul 2010 at 10:53

  • Changed state: Acknowledged
  • Added labels: Type-Enhancement
  • Removed labels: Type-Defect

from solr-php-client.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 26, 2024
I'll see what I can do about it if I get some time.

Original comment by [email protected] on 9 Jul 2010 at 12:29

from solr-php-client.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 26, 2024
Here is an upgraded patch.  I created two new classes. Apache_Solr_SolrOpts, an 
abstract class that provides an easy interface to dealing with search 
parameters and field overrides for those parameters, and 
Apache_Solr_HighlightOpts an extension of that class that takes care of all the 
highlighting parameters.  

I created 2 new instance variables in Apache_Solr_Service, one to keep track of 
the id field, and one to hold the Apache_Solr_HighlightOpts instance.  When the 
search method is called it will pull the (highlight) parameters out of that 
object.

I added a parameter to the Apache_Solr_Service and Apache_Solr_Response 
constructors to allow the feeding in of the id parameter.  The 
Apache_Solr_HighlightOpts is completely handled through getters/setters.

I switched the highlighting around so that it works in the same way that the 
boosts do.

Hopefully the Apache_Solr_SolrOpts class will make it easier for someone (if 
they want to) to do similar work for the facets as well.

Original comment by [email protected] on 14 Jul 2010 at 6:50

Attachments:

from solr-php-client.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 26, 2024
Hi KumoriKage,

Can you give a quick summary of what your patch does?  We've been using 
highlighting with the SPC for close to a year now and haven't had any problems, 
so I'm just wondering what you're adding to it.

Thanks.

Original comment by [email protected] on 2 Dec 2010 at 6:27

from solr-php-client.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 26, 2024
The patch adds a Apache_Solr_HighlightOpts class which has getters and setters 
for each of the possible options for highlighting (those documented on the wiki 
page) including getters and setters for field overrides for each of the 
options.  You can then call $service->setHighlightOptions($options) to provide 
it particular options, or $service->setHighlightOptions() to set the default 
instance (basically the same thing as setting "hl=true" in the options).

The patch adds an argument on the constructor for the name of the id field, so 
that it can match up the highlighting returned by Solr to the Document that it 
comes from.  This allows you to call $document->getFieldHighlighting($field) as 
well as attaching it to the information in $document->getField($field).

I also created an Apache_Solr_SolrOpts class to act as a base for SolrOpts, in 
case somebody wanted to implement something similar for facets.

The patch will likely fail to apply against trunk from SVN.  I believe that the 
revision that I made it against is r36.  However if you would like to use it, I 
will try to update my patch so that it works against trunk.

Original comment by [email protected] on 2 Dec 2010 at 6:58

from solr-php-client.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 26, 2024
Thanks, it sounds like a usability improvement but doesn't seem to add any 
features that we aren't currently able to use; it sounds like it's worth 
adding, but there's no urgency :)

Original comment by [email protected] on 15 Dec 2010 at 3:24

from solr-php-client.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 26, 2024
Hello everyone. I really need highlight feature. 
to [email protected], could you update your patch to the current trunk 
version. Thanks in advance.

Original comment by [email protected] on 20 Jan 2011 at 10:30

from solr-php-client.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 26, 2024
Here is a patch against trunk.

@liam: Sorry it took so long, but just as I got that message things got really 
hectic...thankfully gtp posted this message and reminded me about at just the 
right time (currently have to wait for someone else to continue my work).

@Gtp...:here you go

Original comment by [email protected] on 20 Jan 2011 at 7:26

Attachments:

from solr-php-client.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 26, 2024
Is there any tutorial or example how to use this patch?

Original comment by [email protected] on 29 Aug 2011 at 10:24

from solr-php-client.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 26, 2024
No there isn't.

I'm going to assume you mean how to use the API as opposed to actually applying 
the patch (just looking up how to apply a patch to SVN should work fine for 
that).

Basically, you need to tell Apache_Solr_Service what the ID field for your 
schema is (it defaults to "id"), this can be set through the final argument in 
the constructor or  through the #setIdField method.

If all you want is basic highlighting with no special parameters, all you have 
to do is call #setHighlightOptions() with no parameters. 

If you do need to set highlighting options, then you need to create a new 
Apache_Solr_HighlightOpts instance and use its methods to set whatever options 
you need, and then feed that object to the #setHighlightOptions() method.  

After that you will be able to access the highlighting using the 
#getFieldHighlighting() method or under the "highlighting" key from the 
#getField() method.

Original comment by [email protected] on 29 Aug 2011 at 11:42

from solr-php-client.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 26, 2024
Hi KumoriKage,

I really need highlight feature. 
I do this follow / solr-php-client-highlighting.patch - 46.8 KB / patch. But 
don't highlighting. 

I'm using Apache Solr 4.2 & SolrPhpClient.r60.2011-05-04.zip.

Please assist me on this.

Original comment by [email protected] on 21 May 2013 at 5:10

from solr-php-client.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.