Comments (15)
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.
from manticoresearch-php.
thanks for answer.
Is there any hope of implementation when it will be possible to set weights during client initialization through setRanking()?
from manticoresearch-php.
➤ Sergey Nikolaev commented:
Can you elaborate on your use case? Why is it important to have it on the client initialization phase?
from manticoresearch-php.
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
from manticoresearch-php.
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
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".
here you need to enter a field and do sorting
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 ?
from manticoresearch-php.
thanks for the answer.
I don’t understand yet how to put weights at the fields correctly. let's just say that I have fields about which I wrote above, when I run a search through php-api, I need to produce first of all fields that are more priority in the field of "category description" since there will be "keywords". and then further on the priority of "product name", "product description".
example of sports nutrition products:
- BSN / Sуnta-6 and Isolate / (protein category)
- Bombbar / protein cookies / (category cookies)
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 (
'field1' => 50,
'field2' => 40,
'field3' => 10,
'field4' => 5,
));
your project will be release his implement? or i can use native php client?
from manticoresearch-php.
I don’t understand yet how to put weights at the fields correctly
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 option field_weights
is not available in the new php client, so the only way now to execute the above is by using the sql method
from manticoresearch-php.
I express my gratitude for the detailed answer, I will try to use sql.
I will rewrite my service.
Is there any hope of future API support in the new client?
from manticoresearch-php.
Is there any hope of future API support in the new client?
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.
from manticoresearch-php.
Dear devs
i use SQL mode with field_weight ... and now i need FACET , but php client say "multiple queries not supported"
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 ?
from manticoresearch-php.
and now i need FACET
@skvarovski Hi. Is https://github.com/manticoresoftware/manticoresearch-php/blob/master/docs/searchclass.md#facet not working for you?
from manticoresearch-php.
facet working after update manticore engine from 3.4 to 3.5.4 version.
but php client not support OPTION for field_weights set? may be i can send raw sql ?
from manticoresearch-php.
my temporary solution for use Field_Ranking and FACET is sphinx client (yii2-sphinx)... its work for multiple result (data & facet)
from manticoresearch-php.
may be i can send raw sql ?
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.
from manticoresearch-php.
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.
from manticoresearch-php.
Related Issues (20)
- Request for Transaction Support in manticoresearch-php HOT 1
- Incorrect PHP DocBlock in class \Manticoresearch\Search HOT 2
- ExceptionInterface does not extends Throwable HOT 1
- Return distance when sorting by _geo_distance HOT 1
- Any chance we could get the working Search::sort() out with a new revision 3.0.2 HOT 2
- Server path HOT 4
- PHP Code Style HOT 8
- PhpHttp transport depends on not existing package HOT 2
- In Manticore Search 6.2.12 version some forbidden chars breaks request even after escaping... HOT 1
- Drop support for older versions of php HOT 7
- The first request is not search request if using basic auth HOT 8
- Discussions for Q&A HOT 1
- Document ID started from huge number HOT 1
- getDocumentByIds doees not work: "self" in callables is deprecated HOT 3
- ResponseException with message ""\"in\" filter should contain an array of values for not sequencial ids HOT 1
- `getDocumentByIds` returns not all documents when size of array > 20 HOT 3
- Correct pagination HOT 1
- It doesn't throw ResponseException on response error HOT 1
- Add support of method chaining for knn HOT 4
- Float encoding problem HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from manticoresearch-php.