Is there a way to limit Mediawiki's srsearch facility to a particular category? For example is it possible to restrict the below search
/w/api.php?action=query&list=search&format=json&srsearch=relativity
to the Category:Alert_Einstein category?
Depends on what search engine you are using. CirrusSearch, for example, can do that with the incategory: keyword.
Related
I have simple mySql query in my php code:
query(sprintf(SELECT * FROM customers WHERE city='%s' AND state='%s' AND age='%s'(...))
This query is used in search engine in my application. I want user to be able to search, for example, customers from New York, but for now he must specify 'state' and 'age'.
User can specify search filter by more than one criteria, but doesn't have to specify all of them.
Is there any method that will bypass values not used in current search session?
i believe that you are looking for CASE statement.
https://dev.mysql.com/doc/refman/5.7/en/case.html
I am trying to use the Amazon Product Advertising API to find relevant products.
I am searching using multiple keywords and am hoping to receive relevant results based on those keywords. The keywords can be random and at times not related at all to each other, so I want to find results that match the max number of keywords possible.
For example if I were to search using the keywords, 'Cat Figure Toys Kite Sim' I would hope to receive (at least) this result back, because it matches 3 of 5 keywords. At the moment for this search, no results are returned.
To make that search here is an example URL as displayed in the Scratchpad:
http://webservices.amazon.com/onca/xml?Service=AWSECommerceService&Operation=ItemSearch&SubscriptionId=XXX&AssociateTag=XXX&SearchIndex=All&Keywords=Cat%20Figure%20Toys%20Kite%20Sim&ResponseGroup=Images,ItemAttributes,Offers
(Subscription ID and Associate Tag commented out).
Are the power search terms that I am not aware of that would make this request work?
It is my first project using SOLR, I have indexed the all products in solr and created a copyField named searchable. Copied field like product_title, description, categories titles, filters in this field.
I am using query given below to get results.
http://localhost:8080/solr/testcore/select?indent=on&q=status:1 AND is_single:0 AND searchable:sleeve+medium AND seller_status:1&wt=json
I am getting the matching results but couple of questions I have:
Is there any mechanism to sort result by exact match on top
I indexed the quantity and stock status of product, Can I give low weightage to products which have quantity = 0 or stock_status = 'Out of Stock" so out of stock items always display in bottom of search.
Thank you.
You can find the answer to your first question here.
About the second question, using eDismax you can use the boost query (bq) value:
bq=stock_status:"Out of Stock"^-0.1
in general though is better to boost important documents than de-boost docs with low importance.
I've been looking over the web for a way to restrict price range on google search shop API but I wasn't able t find any answer. (Let's say I want products between 20 to 40 $)
In the official documentation, it seems to have ne reference to this functionnality (only rank by Price)
Neither Here nor Here
Also,
I've been looking at this post in stackO but the answer doesnt seem to bring a good solution to the question (he is just stating the technology to use). Is there a way to do so ?
Thank you
Add this to URL of your API call.
&restrictBy=price:[20,40]
It will return products with prices in between 20 and 40 both inclusive.
&restrictBy=price:(20,40]
And the above query will return products with prices above 20.
Refer
https://developers.google.com/shopping-search/v1/reference-request-parameters#restricting-products
Where I have a search which has a category (foreign key) and optional text, should I use thinking sphinx to "search" where a search string has not been submitted, solely the category?
It really depends on your use case. Let's say for example you have blog posts, and they have categories a, b, and c.
If you want yoursite.com/a/ to list all posts in category a in order from newest to oldest, then it's probably not the greatest idea to use sphinx/search for that. It will be a simple database query, possibly with pagination.
However, let's say you want that page to list all posts with that category, or that might relate to that category according to the text, and also maybe posts that have tags related to that category. In this case, it is probably best to use a search engine, like sphinx, to power this page. The search engine will be much faster if the equivalent database query is very expensive.