text search issues
Following https://dev.solita.fi/2023/01/04/xtdb-phoenix.html
Ran the standalone jar file in "Demo" mode
querying record works, searching fails
iex(xthello@localhost)54> :xt.put(%Person{id: "demo1",
...(xthello@localhost)54> first_name: "Dear",
...(xthello@localhost)54> last_name: "Reader",
...(xthello@localhost)54> email: "[email protected]"})
{:ok, {0, {:timestamp, 1685713809670}}}
iex(xthello@localhost)55> :xt.ql(%Person{first_name: "Dear"})
[
%Person{
id: "demo1",
first_name: "Dear",
last_name: "Reader",
email: "[email protected]"
}
]
iex(xthello@localhost)56> :xt.ql(%Person{email: {:textsearch, "example"}})
[]
I thought it's possibly due to the mode I am running xtdb in.
What sort of error are you getting with text search? The demo config does include the Lucene full text search.
It is probably best to run the Clojure XTDB node separately (see xtdb/run.sh)
@tatut thanks for your response, and for this incredible work
I actually wasn't getting an error, but just no results (see the empty list)
iex(xthello@localhost)56> :xt.ql(%Person{email: {:textsearch, "example"}})
[]
However, I agree that I should just run the XTDB node as you have it in this repo. I'll try that next.
In the end this did work, I just didn't give xtdb lucene enough characters.
Once I added more, searching works
iex(xthello@localhost)41> :xt.ql(%Person{email: {:textsearch, "dear.reader"}})
[
%Person{
id: "demo1",
first_name: "Dear",
last_name: "Reader",
email: "[email protected]"
}
]
iex(xthello@localhost)42> :xt.ql(%Person{email: {:textsearch, "example"}})
[]
iex(xthello@localhost)43> :xt.ql(%Person{email: {:textsearch, "example.com"}})
[
%Person{
id: "demo1",
first_name: "Dear",
last_name: "Reader",
email: "[email protected]"
},
%Person{
id: "demo2",
first_name: "Bob",
last_name: "Boogie",
email: "[email protected]"
}
]