Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Comments on Search function not working in a new instance

Post

Search function not working in a new instance Question

+2
−0

I have successfully set up QPixel on my local machine, but any attempt to use the "Search" function fails with "Your search syntax is incorrect.".

I found out that this is caused by an exception in app/controllers/search_controller.rb, that contains the message: "Error: Mysql2::Error: Can't find FULLTEXT index matching the column list"

I understand that I need to setup a FULLTEXT index on a table in the database, as it was not done automatically during the installation. How to do that?

History

1 comment thread

Just in case - have all migrations run successfully? (3 comments)
Just in case - have all migrations run successfully?
Oleg Valter‭ wrote 26 days ago · edited 26 days ago

The index is supposed to be created automatically when you run rails db:migrate. What's the output of rails db:migrate:status (its output is quite lengthy, so it'll be easier to run rails db:migrate:status | grep "fulltext")? If the index is supposed to be there, you'll see something along the lines of up 20191207001359 Add search fulltext index to posts. If the migration is present in the output and its status is "up", it's probably a bug of ours.

Arnaud‭ wrote 26 days ago · edited 26 days ago

Thanks for your help. I have run rails db:migrate:status|grep "fulltext" and I get:

   up     20191207001359  Add search fulltext index to posts

(and all other migrations have the status "up" too)

Is there any immediate solution, like running the migration step again manually or running some SQL statements directly in the database?

Oleg Valter‭ wrote 26 days ago

The output looks fine, yeah. Let's see if anything else is amiss (as soon as we establish what exactly is wrong, I'll be able to advise on what to do to resolve it) - select index_schema, table_name, index_name, column_name, collation, is_visible from information_schema.statistics where index_type = 'FULLTEXT'; (I included index_schema for clarity - it'll contain your database names, so you'll likely want to edit them out) should show whether the necessary indexes exist and are correctly configured. A good output should contain at least two entries for the index_posts_on_body_markdown_and_title index with column names body_markdown and title (is_visible should be YES on both of the columns too).