-
Notifications
You must be signed in to change notification settings - Fork 32
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
Can i use setMachRanking? #42
Comments
Hi Unfortunately only via https://github.com/manticoresoftware/manticoresearch-php/blob/master/docs/sql.md and https://docs.manticoresearch.com/latest/html/sphinxql_reference/select_syntax.html?highlight=field_weights#option as OPTIONS is not implemented in the JSON interface yet which the php client depends on. I'll keep this issue open until it is. |
thanks for answer. |
➤ Sergey Nikolaev commented: Can you elaborate on your use case? Why is it important to have it on the client initialization phase? |
for example, I have the fields "brand name", "name" and "product description", "category description", and etc. I would like to select the necessary weights for these fields dynamically. just setting weights for each of the fields before the request. Previously, through sphinxApi, this was done quite simply, but here you need to enter a field and do sorting |
What's interesting is whether and why you really need to be able to set field weights on CLIENT initialization phase or it's sufficient to be able to do it before EACH query. E.g. the likely reason may be that your field weights are constant and you are never going to change them, so you would like to put the to your application config or hardcode in the client initialization code and forget about them in other parts of your app. But it's a little bit in contra with "select the necessary weights for these fields dynamically".
Can you provide more details on "here you need to enter a field and do sorting". What exactly do you mean? Using the SQL endpoint https://github.com/manticoresoftware/manticoresearch-php/blob/master/docs/sql.md ? |
thanks for the answer. example of sports nutrition products:
when searching for "protein" cookies are now in the top. Previously, I remember the opportunity to prioritize the fields when ranking, how to do this with weights - I don’t understand, it’s more likely not to be possible. upd. I find my old code. i use API ->SetFieldWeights(array ( your project will be release his implement? or i can use native php client? |
Here's how it can be done via SQL: MySQL [(none)]> create table t(field1 text, field2 text, field3 text, field4 text);
MySQL [(none)]> insert into t(field1, field2, field3) values('BSN','Snta-6 and Isolate','protein'),('Bombbar','protein cookies','cookies');
MySQL [(none)]> select * from t where match('protein');
+---------------------+---------+--------------------+---------+--------+
| id | field1 | field2 | field3 | field4 |
+---------------------+---------+--------------------+---------+--------+
| 1657913280053641218 | BSN | Snta-6 and Isolate | protein | |
| 1657913280053641219 | Bombbar | protein cookies | cookies | |
+---------------------+---------+--------------------+---------+--------+
MySQL [(none)]> select * from t where match('protein') option field_weights=(field2=10,field3=1);
+---------------------+---------+--------------------+---------+--------+
| id | field1 | field2 | field3 | field4 |
+---------------------+---------+--------------------+---------+--------+
| 1657913280053641219 | Bombbar | protein cookies | cookies | |
| 1657913280053641218 | BSN | Snta-6 and Isolate | protein | |
+---------------------+---------+--------------------+---------+--------+ The functionality |
I express my gratitude for the detailed answer, I will try to use sql. |
Sure, as soon as we add support for the OPTIONS in the JSON interface we'll add it to the client. I'm keeping this issue open until then. |
Dear devs my sql = "SELECT * FROM shop where MATCH('".$text."') limit 1000 option field_weights=(name_tov=40,brand_name=60,category_keywords=80,category_description=20,product_description=10) FACET category_id;" it's time to use JSON API interface ? |
@skvarovski Hi. Is https://github.com/manticoresoftware/manticoresearch-php/blob/master/docs/searchclass.md#facet not working for you? |
facet working after update manticore engine from 3.4 to 3.5.4 version. |
my temporary solution for use Field_Ranking and FACET is sphinx client (yii2-sphinx)... its work for multiple result (data & facet) |
Yes, you can - https://github.com/manticoresoftware/manticoresearch-php/blob/master/docs/sql.md I'm closing this issue as there seems to be no further work required. Reopen it or create another one if you find more issues with the client. |
I'm reopening it since it was closed by mistake since the original problem was that the php client can't set field weights. It's still so. Let it be open until it's fixed. |
Hello Devs
Can i use Ranking for this module? Can i use Weight for field's?
in documentation not found information
The text was updated successfully, but these errors were encountered: