K
K
khariv29072020-04-22 14:00:39
Sphinx
khariv2907, 2020-04-22 14:00:39

How to make a 'like' condition in Sphinx?

For example, there is a date column:
2017-11-04
2017-11-17
2017-11-17
2017-01-01
2020-11-04


You need to get all the dates "11-04" of all years, or roughly speaking with the LIKE condition "%-11-04"

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Tikhonov, 2020-04-23
@khariv2907

For text fields, you can enable infix indexing, then by increasing the size of the index, you can write something like *-11-04. But it's better to make three separate attributes and search for the exact expression month=11 and day=4. There is also a function for unpacking the date.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question