etianen / django-watson

Full-text multi-table search application for Django. Easy to install and use, with good performance.
BSD 3-Clause "New" or "Revised" License
1.21k stars 129 forks source link

Can't search char field that contains a number or IP address. #246

Closed aaronweaver closed 4 years ago

aaronweaver commented 6 years ago

Using: 1.5.2

When I update a field or try to search for an existing field that contains a number such as 127 or 127.0.0.1 I don't get any results. The backend is mysql. Would there be any setting that would cause that? Is there anyway to view the underlying query?

Example: clean_query = "127.0.0.1" endpoints = watson.search(clean_query, models=(Endpoint,))

Model: host = models.CharField(null=True, blank=True, max_length=500, help_text="The host name or IP address, you can also include the port number. For example" "'127.0.0.1', '127.0.0.1:8080', 'localhost', 'yourdomain.com'.")

etianen commented 6 years ago

Check out the MySQL setting "ft_min_word_len". I think you might want to set it to 2 or 3, so it doens't ignore short numbers.

On 19 May 2018 at 18:38, Aaron Weaver notifications@github.com wrote:

Using: 1.5.2

When I update a field or try to search for an existing field that contains a number such as 127 or 127.0.0.1 I don't get any results. The backend is mysql. Would there be any setting that would cause that? Is there anyway to view the underlying query?

Example: clean_query = "127.0.0.1" endpoints = watson.search(clean_query, models=(Endpoint,))

Model: host = models.CharField(null=True, blank=True, max_length=500, help_text="The host name or IP address, you can also include the port number. For example" "'127.0.0.1', '127.0.0.1:8080', 'localhost', 'yourdomain.com'.")

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/etianen/django-watson/issues/246, or mute the thread https://github.com/notifications/unsubscribe-auth/AAJFCFVN-eTnQCv_0-D4dA7llx-3efkXks5t0FiwgaJpZM4UFyoE .

frnhr commented 5 years ago

Seems to be more complicated with Postgres :(