Skip to content
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

Merged
merged 9 commits into from Nov 22, 2016
Merged

Conversation

jberger
Copy link
Contributor

@jberger jberger commented Nov 22, 2016

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.

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;
Copy link
Member

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.

Copy link
Contributor Author

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).

Copy link
Member

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.

@coveralls
Copy link

coveralls commented Nov 22, 2016

Coverage Status

Coverage remained the same at 74.121% when pulling 439f14f on jberger/web_search_endpoint into fcc1d6e on master.

@oalders oalders merged commit d174bff into master Nov 22, 2016
@oalders oalders deleted the jberger/web_search_endpoint branch November 22, 2016 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants