-
Notifications
You must be signed in to change notification settings - Fork 171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fulltext searching in datastore query #3812
Conversation
CodeClimate is complaining about 21 methods in SelectFactory. I think a refactor there that would actually lead to cleaner code would be a big lift and make more sense as part of work to pull AbstractDatbaseTable and its derivatives out of the rest of DKAN. That's way out of scope for this issue so I'd argue that we should mark this as a known issue for now but give it a pass. I'll leave that up to whoever reviews this though. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The overall structure looks good. I've left a couple suggestions related to test coverage and one comment related to the new index portion of the schema.
Co-authored-by: Clayton Liddell <clayton.liddell@civicactions.com>
Whoops somehow merging those suggestions broke everything @clayliddell - will investigate. FWIW I'm not a big fan of that feature in github. Also I noticed a potential issue in my code - I just have that one placeholder |
This is a somewhat experimental feature for now and will not be fully documented until we have used it a bit more in the wild. But this allows fulltext boolean match queries against a datastore resource in MySQL if the column(s) being queries are properly indexed.
This PR also adds two new keys to the schema object in the datastore response. One is
indexes
which lists all standard indexes on the database table, as per the Drupal Schema API spec. Another isfulltext indexes
, which follows the same pattern. This is not part of the official Drupal Schema spec but I felt was needed to signal to the user what columns are available for fulltext searching, and matches the rest of the spec as closely as possible.QA steps
This will need to be test locally since for now we need to create the fulltext indexes manually. Set up a local site with the demo content.
drush dkan:dataset-info d460252e-d42c-474a-9ea9-5287b1d595f6
to get the table name of the datastore. Let's say itsdatastore_efee6d8c0ee35d0b1a161743806d018d
.drush sqlc
.schema
object in the response and confirm that the fulltext index is listed properly.