Hi everyone! I'm trying to write a query that filt...
# general
r
Hi everyone! I'm trying to write a query that filters results with the expression " SELECT * from TABLE WHERE TEXT_MATCH(city, '/^Lon/')". I want to obtain the cities that start with "Lon". I don't know if that it's possible in Pinot. Probably my regex is wrong, but I can't find a solution. Thanks!!!
k
Lon*
should work
r
Ok thanks!, if I use
WHERE TEXT_MATCH(city, '/Lon*/')
. Pinot returns random results such as, "*Ban Chang Lo, Thailand*". On the other hand, if I use
WHERE TEXT_MATCH(city, 'Lon*')
the results are more accurate (eg "*Tottenham, London*"). But I want only cities that start with "Lon" for example "*Longview, Texas*"
k
yeah, the lucene library used under the hood does not support startswith.. we recently added a native text index feature in Pinot. that might support the prefix syntax cc @Atri Sharma
r
Ok, understood. Where can I read about the capabilities of the native text index?
a
The documentation has a page on native index
And it supports prefix syntax using TEXT_CONTAINS
r
Ok, I'm looking for the native index in the documentation but I'm not finding it. I would appreciate it if you could share with me the documentation and how to use it. Thanks!!🙏
a
That's weird. Let me send you a link to the github page that has the documentation
👍 1
@Roberto you should try the native text index, you might find it faster and cheaper than the stock one
r
Sure!. First I need to know how to configure or activate this index 🙂
a
It's funny you can't find the documentation. I must have screwed up the link somewhere
r
Have you shared the link with me?
r
Thanks! I will try it.
I tried to deploy this changes in the table definition
{"name":"city","encodingType":"RAW","indexType":"TEXT", "properties":[{"fstType":"native"}]}
and got this error:
Copy code
(through reference chain: org.apache.pinot.spi.config.table.TableConfig[\"fieldConfigList\"]->java.util.ArrayList[1]->org.apache.pinot.spi.config.table.FieldConfig[\"properties\"])
What version I should use to activate native text indice? I use 0.8.0. Should update to 0.10.0?
a
Ugh, I forgot. This is still in master branch
r
🥲 I use docker in local, so I guess that I can't test this feature. How can I test this feature locally?
a
If you build from the master branch, you can setup a local Pinot node and try it out
This will be released in the next release. I am cutting the branch on Monday so should be pretty soon
r
Great!
Thanks for the support and the info!
a
Looking forward to helping you out in getting this deployed
👌 1
k
If you use the latest docker image, you should be able to test it. Docker images get built every night
z
Hi 👋 I am trying “starts with” with native text index but no luck
I try TEXT_CONTAINS(“col”, “^term”)
Am I missing something here
a
What error are you seeing?