forked from lbdremy/solr-node-client
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
NEW: Add 'get' method to make arbitrary requests
- Loading branch information
Showing
1 changed file
with
28 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5e1edd4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vladif I wasn't around here when you first made this request, so excuse my ignorance.
AFAICS this only introduces an extra path argument compared to the available search() method, right?
This leaves me with a number of questions/remarks:
5e1edd4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Marc,
this.options.path,this.options.core,'select?'
, and I don't think it would be correct to make any changes to the original API.5e1edd4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Vlad, thx for the clarification.
5e1edd4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2-3. If you are concerned about naming, and want to reserve "get" for the real time get, we can of course rename it, though I don't see any problem just using it it as
solr.get('/get', ..., function()...)
😄5e1edd4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LOL. Maybe we should let @lbdremy clarify which naming he thinks best fits the way he intended the library then?
Side-question for my understanding: how are these suggesters similar of different to what .spell() is doing on the node-client?
Anyway the fact that you needed multiple variants of suggesters surely show that in the brother sense just whatever custom handler that was defined in one's specific solr instance must be easily-callable. So now I really get your need.
One step further: we should probably also consider the need for people to send off POST requests to custom handlers too? In that case my earlier proposed handler() would either need a method (first) argument or would naturally fall apart into handleGet() versus handlePost(). Eurhm, yes, obviously and deliberately not get() and post() :)
Just to make clear: I only found your commit through a search for 'get' on this repo prior to starting on my lbdremy#88 implementation. I choose to make contact to avoid issues or unexpected side-effects on either side. But (as you stated yourself) we should balance for 'clarity of the API' as well...
As soon as we iron this out, I'll be happy to implement whatever we can agree upon as part of lbdremy#88
5e1edd4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, this whole thing is so simple, and either implementation is quite trivial, so I honestly don't see much sense arguing about naming conventions and semantics 😃 I'd suggest you to just make a pull request with your implementation, I'm okay if any other code gets merged instead of mine, we can easily adapt our code to use any API. We're now using the library from my fork, however, we'll just change our code once any implementation of this functionality is available in the original library.
Regarding your question about .spell() I actually haven't checked how it works, but I suppose it is very similar, and differs just by some minor parameters.