-
Notifications
You must be signed in to change notification settings - Fork 2
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
ElasticSearch probably isn't needed at all and just makes things a lot more complicated #2
Comments
Prefixed words are allowed. Counting documents w/Kekistan*, Kekistan and Kekistani in 0.141ms
EXPLAIN ANALYZE SELECT s.*, s.has_word_that_begins_with_kekistan - s.has_kekistani - s.has_kekistan AS "has_kekistan*-has_kekistan-has_kekistani" FROM (SELECT (SELECT COUNT(id) FROM posts_post_documents d WHERE TO_TSVECTOR('english'::REGCONFIG, document) @@ TO_TSQUERY('Kekistan:*')) has_word_that_begins_with_kekistan, (SELECT COUNT(id) FROM posts_post_documents d WHERE TO_TSVECTOR('english'::REGCONFIG, document) @@ TO_TSQUERY('Kekistan')) has_kekistan, (SELECT COUNT(id) FROM posts_post_documents d WHERE TO_TSVECTOR('english'::REGCONFIG, document) @@ TO_TSQUERY('Kekistani')) has_kekistani) s;
(45 rows) Showing 5 «Kekistan»-prefixed documents (in metadata or document body) in 0.069msEXPLAIN ANALYZE SELECT * FROM posts_post_documents d WHERE TO_TSVECTOR('english'::REGCONFIG, document) @@ TO_TSQUERY('Kekistan:*') OR TO_TSVECTOR('english'::REGCONFIG, metadata) @@ TO_TSQUERY('Kekistan:*') LIMIT 5;
(5 rows) |
This is excellent -- I had originally been using |
In #1 I mentioned how ES is probably unneeded for pagination and other simple tasks.
Actually now I think it's totally unneeded.
Running to get simple field-only searches:
And for complex pseudo-documents:
I hardly think we can do better than this.
Document search for
damnatio AND memoriae
completing in 0.123ms(10 rows)
Body search for
damnatio OR memoriae
completing in 17.260ms(14 rows)
The text was updated successfully, but these errors were encountered: