Why Solr search is giving zero values in this case - magento

I've got this problem that I can't solve. Partly because I can't explain it with the right terms. I'm new to this so sorry for this clumsy question.
Below you can see an overview of my goal.
I'm using Magento CE 1.7.0.2 & Solr 4.6.0.
Here you can see my goal..
http://127.0.0.1:8055/solr/collection1/select?q="mens+jeans"&indent=true&defType=dismax&pf=fulltext&qs=2
In this case its giving exact products But if i'm searching with jeans mens means its giving zero products.
http://127.0.0.1:8055/solr/collection1/select?q="jeans+mens"&indent=true&defType=dismax&pf=fulltext&qs=2
But i want to get same products for the both cases...
Any Ideas ?

It depends on you have indexed your docs (like Denis wrote at the comment) or it also could depends on your default searching settings.
For example: If all your queries are executed as a phrase-search, so it could be the situation, that your text contains mens ... jeans but never jeans ...mens
You should use an tokenizer and try to use the same field-settings for index- and search-time.
Looking at you solr-webpage you, probably, can use this link: http://127.0.0.1:8055/solr/#/collection1/analysis There you can see, how solr handles the different kind of queries.
This "Analysis"-Feature helps to optimize the field-settings for index- and search-time.

Related

how to get most popular results first in elastic-search

I'm learning elastic search,
I wanted to ask if there is any way to get most searched results first,
like:
by altering the documents and updating a value of em with scores,
using some kind of formula or something else
thanks community :)
You don't have that out of the box but you can indeed modify a document and increase the number of views when a user clicks on a result then use that field as part of the score (function_score might help for this).

Magento Solr: Increase weight of title in schema.xml?

I have a Magento-installation with Solr search. This works fairly well although it doesnt give relevant hits on a few queries. It seems that the the "title" attribute is not weighed higher than other attributes such as "description". Is there any way to define that title should have a higher weight in schema.xml?
Or any other ideas on how to manipulate the search results of a specific product? E.g. adding another attribute with some meta keywords?
I'm new to Solr so any feedback is appreciated!
My schema.xml is located here.
What you're looking for is called 'boosting' .
You can do boosting at index-time (more performant at query time) and at query-time (more flexible)
More here:
How to boost fields in solr

Apache SOLR sort order

I'm using apache solr search in shop based on magento enterprise.
I have some hard problem, and I can't solve it by myself. if some who have solr expirience please help me;)
Solr search is pretty good and it works fine, but I have issue about sorting search results.
I can explain it by example:
We search product by query ex. "HP-118",
and we receive response with ex. 40 products.
In this order "HP-118 LaserJet", "HP-118 DescJet", "HP-118 box case", "Simple thing for HP-118", "Another simple thing for HP-118", "HP-118 BoxJet" etc...
And my problem is in last product in example.
I need to see products that have search query at the begining together..
ex. "HP-118 LaserJet", "HP-118 DescJet", "HP-118 box case","HP-118 BoxJet", "Simple thing for HP-118", "Another simple thing for HP-118"
Thanks for any help !
It all comes to score value (unless you explicitly set other sort order). To check why your results are returned in this order you can do few things:
Read http://wiki.apache.org/solr/SolrRelevancyFAQ
Add score to returned fields, so you can see difference etc. (and score to fl parameters)
Turn on the debug mode in responces (add &debugQuery=on parameter to request)
Study the debug, it will tell you why given result is scored with the value X
I hope that you will find the answer in the debug.
There are ways to boost specific fields, but to help with this you would need to specify more info.

Magento 1.3.x Quick Search problem

We have built a website http://www.goshopping.pk/ (sorry had to post the link as its important for this question).
The quick search is not working as it should. For example, search "Nokia" and you will get all sorts of results. Search "Dell" and you get the same results. However, searching exact matches like "nokia 6600" or "Intel Core 2 DUO" or "Dell Inspiron" works perfectly fine.
We have rebuilt the search index, emptied the cache etc but it has no effect. What are we missing?
Help appreciated. Thanks!
One quick tip I normally advise people is to remove the description from quick search results in Catalog > Manage Attributes > Attributes
Obviously the description contains all sorts of words and can dilute search results. See if that improves anything.
Also in Configuration > Catalog I normally change the Search Type to Fulltext for more accurate results.
Based on the suggestion from Adam, we were able to resolve this. Here is what we did if anyone needs future reference:
We had about 400 attributes defined and a lot of them were set to search in quick search by our client. What we did is we manually ran a query via phpmyadmin for table "eav_attribute" and updated ALL records to have is_searchable=0
We then manually edited the title and description record in eav_attribute table to is_searchable=1
Rebuilt the search index via Mage Admin and all was good.
Best,
K

How to filter results based on order in Solr?

I need to facet inside n documents which are selected like
... ORDER BY something DESC LIMIT 100
Is that possible with Solr? How?
this is a total hack, but here goes...
do your initial query, and get your results back.
construct a new query, like so:
http://localhost:8080/solr/select/?q=id%3A123+OR+id%3A456...(keep OR-ing them up)...&facet=true&facet.field=something
where you concatenate all of your ids to a new query using OR. then, when you facet on your field, the facet summary will only apply to the results.
AFAIK no, that's not supported / implemented. Facets aren't really meant to be "stats" but a guidance to the end-user. Picture yourself browsing a faceted interface and seeing facets change whenever you change sort order or paging. Faceted browsing would be useless if it worked like that.
I think this would be a nice feature for the StatsComponent though.
I think this is possible with results grouping (now in trunk!):
http://wiki.apache.org/solr/FieldCollapsing
... the only problem is that you can set only one 'facet.field' (i.e. group.field)
But the great thing is that you get scored facets!

Resources