New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add web and simple search endpoints #579
Conversation
This is related to metacpan-web's module-model's search method. This then needs to be wrapped into search_expanded, search_collapsed etc.
Also rename the web_like endpoint to simple. This needs reevaluation later.
these are the commits that were taken a15e24e51cabd710eca6a24c1c5214732101ef85 - boost (haarg) 4302a53b1d0a08cf5a41dcf19e9142877f366b13 - splice (oalders)
Also merge the model methods into one entry point. The frontend has previously munged the query, we take that munging now. From that we determine if the results should be expanded or collapsed based on the query itself. For flexibility we now also all explicitly passing a flag indicating whether we want collapsed results. Additionally we return in the data whether the results are actually expanded or collapsed for inspection which is especially useful when the backend decided what to do based on the query. Note that the result structure does not depend on collapsing or not, just the data contained within it.
@@ -0,0 +1,484 @@ | |||
package MetaCPAN::Model::Search; | |||
|
|||
use Moose; |
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.
Any reason not to use MetaCPAN::Moose
here? That gives you MooseX::StrictConstructor
for free.
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.
The only reason I can think of is that I didn't know about it (also, I copied from MetaCPAN::Model::Release which does't use it).
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.
Cool. Maybe we can make that change later. It would be nice to use it where possible.
The web search is the true gain here, the simple search avoids most of the input and output aggregation and munging and is therefore easier to reason about for say search optimization.