Clojure Java Lucene: ComplexPhraseQueryParser with multiple fields
up vote
0
down vote
favorite
Who can I use ComplexPhraseQueryParser
on multiple fields?
Right now, my code uses MultiFieldQueryParser.
and looks like this:
(defn parse-multi-query
"Parses term query-string and searches against all indexed-keys
with AND condition, OR condition being reached with comma sep in input-term.
Appends to input-term AND account_id
Parses term (string) and look for result in all index keys
except when a key is specified in query string (e.g. color:blue)"
[^String query-string]
(.parse (doto (MultiFieldQueryParser. ;; ComplexPhraseQueryParser
(into-array ["color" "id" "other-id"])
(ClassicTokenizer.))
(.setDefaultOperator QueryParser$Operator/AND))
query-string))
This works fine but cannot do complex queries supported by ComplexPhraseQueryParser
And I cannot pass (into-array (map #(str (name %)) indexed-keys))
to ComplexPhraseQueryParser
Thank you so much!
java clojure lucene
|
show 2 more comments
up vote
0
down vote
favorite
Who can I use ComplexPhraseQueryParser
on multiple fields?
Right now, my code uses MultiFieldQueryParser.
and looks like this:
(defn parse-multi-query
"Parses term query-string and searches against all indexed-keys
with AND condition, OR condition being reached with comma sep in input-term.
Appends to input-term AND account_id
Parses term (string) and look for result in all index keys
except when a key is specified in query string (e.g. color:blue)"
[^String query-string]
(.parse (doto (MultiFieldQueryParser. ;; ComplexPhraseQueryParser
(into-array ["color" "id" "other-id"])
(ClassicTokenizer.))
(.setDefaultOperator QueryParser$Operator/AND))
query-string))
This works fine but cannot do complex queries supported by ComplexPhraseQueryParser
And I cannot pass (into-array (map #(str (name %)) indexed-keys))
to ComplexPhraseQueryParser
Thank you so much!
java clojure lucene
What are you trying to do? Why can't you do complex queries?
– Carcigenicate
Nov 22 at 15:42
I want to run complexe queries on multiply fields"123456*" AND NOT color: "Blue"
orid:123456*,other-id:223456*
or"(john jon jonathan~) peters*"
– leontalbot
Nov 22 at 15:47
What's the problem? What have you tried? What specifically do you need help with?
– Carcigenicate
Nov 22 at 16:06
And I cannot pass(into-array (map #(str (name %)) indexed-keys))
toComplexPhraseQueryParser.
which is want I want
– leontalbot
Nov 22 at 16:09
IsMultiFieldQueryParser
aComplexPhraseQueryParser
?
– Carcigenicate
Nov 22 at 16:11
|
show 2 more comments
up vote
0
down vote
favorite
up vote
0
down vote
favorite
Who can I use ComplexPhraseQueryParser
on multiple fields?
Right now, my code uses MultiFieldQueryParser.
and looks like this:
(defn parse-multi-query
"Parses term query-string and searches against all indexed-keys
with AND condition, OR condition being reached with comma sep in input-term.
Appends to input-term AND account_id
Parses term (string) and look for result in all index keys
except when a key is specified in query string (e.g. color:blue)"
[^String query-string]
(.parse (doto (MultiFieldQueryParser. ;; ComplexPhraseQueryParser
(into-array ["color" "id" "other-id"])
(ClassicTokenizer.))
(.setDefaultOperator QueryParser$Operator/AND))
query-string))
This works fine but cannot do complex queries supported by ComplexPhraseQueryParser
And I cannot pass (into-array (map #(str (name %)) indexed-keys))
to ComplexPhraseQueryParser
Thank you so much!
java clojure lucene
Who can I use ComplexPhraseQueryParser
on multiple fields?
Right now, my code uses MultiFieldQueryParser.
and looks like this:
(defn parse-multi-query
"Parses term query-string and searches against all indexed-keys
with AND condition, OR condition being reached with comma sep in input-term.
Appends to input-term AND account_id
Parses term (string) and look for result in all index keys
except when a key is specified in query string (e.g. color:blue)"
[^String query-string]
(.parse (doto (MultiFieldQueryParser. ;; ComplexPhraseQueryParser
(into-array ["color" "id" "other-id"])
(ClassicTokenizer.))
(.setDefaultOperator QueryParser$Operator/AND))
query-string))
This works fine but cannot do complex queries supported by ComplexPhraseQueryParser
And I cannot pass (into-array (map #(str (name %)) indexed-keys))
to ComplexPhraseQueryParser
Thank you so much!
java clojure lucene
java clojure lucene
edited Nov 22 at 17:27
asked Nov 22 at 15:29
leontalbot
1,6141226
1,6141226
What are you trying to do? Why can't you do complex queries?
– Carcigenicate
Nov 22 at 15:42
I want to run complexe queries on multiply fields"123456*" AND NOT color: "Blue"
orid:123456*,other-id:223456*
or"(john jon jonathan~) peters*"
– leontalbot
Nov 22 at 15:47
What's the problem? What have you tried? What specifically do you need help with?
– Carcigenicate
Nov 22 at 16:06
And I cannot pass(into-array (map #(str (name %)) indexed-keys))
toComplexPhraseQueryParser.
which is want I want
– leontalbot
Nov 22 at 16:09
IsMultiFieldQueryParser
aComplexPhraseQueryParser
?
– Carcigenicate
Nov 22 at 16:11
|
show 2 more comments
What are you trying to do? Why can't you do complex queries?
– Carcigenicate
Nov 22 at 15:42
I want to run complexe queries on multiply fields"123456*" AND NOT color: "Blue"
orid:123456*,other-id:223456*
or"(john jon jonathan~) peters*"
– leontalbot
Nov 22 at 15:47
What's the problem? What have you tried? What specifically do you need help with?
– Carcigenicate
Nov 22 at 16:06
And I cannot pass(into-array (map #(str (name %)) indexed-keys))
toComplexPhraseQueryParser.
which is want I want
– leontalbot
Nov 22 at 16:09
IsMultiFieldQueryParser
aComplexPhraseQueryParser
?
– Carcigenicate
Nov 22 at 16:11
What are you trying to do? Why can't you do complex queries?
– Carcigenicate
Nov 22 at 15:42
What are you trying to do? Why can't you do complex queries?
– Carcigenicate
Nov 22 at 15:42
I want to run complexe queries on multiply fields
"123456*" AND NOT color: "Blue"
or id:123456*,other-id:223456*
or "(john jon jonathan~) peters*"
– leontalbot
Nov 22 at 15:47
I want to run complexe queries on multiply fields
"123456*" AND NOT color: "Blue"
or id:123456*,other-id:223456*
or "(john jon jonathan~) peters*"
– leontalbot
Nov 22 at 15:47
What's the problem? What have you tried? What specifically do you need help with?
– Carcigenicate
Nov 22 at 16:06
What's the problem? What have you tried? What specifically do you need help with?
– Carcigenicate
Nov 22 at 16:06
And I cannot pass
(into-array (map #(str (name %)) indexed-keys))
to ComplexPhraseQueryParser.
which is want I want– leontalbot
Nov 22 at 16:09
And I cannot pass
(into-array (map #(str (name %)) indexed-keys))
to ComplexPhraseQueryParser.
which is want I want– leontalbot
Nov 22 at 16:09
Is
MultiFieldQueryParser
a ComplexPhraseQueryParser
?– Carcigenicate
Nov 22 at 16:11
Is
MultiFieldQueryParser
a ComplexPhraseQueryParser
?– Carcigenicate
Nov 22 at 16:11
|
show 2 more comments
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53434142%2fclojure-java-lucene-complexphrasequeryparser-with-multiple-fields%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
What are you trying to do? Why can't you do complex queries?
– Carcigenicate
Nov 22 at 15:42
I want to run complexe queries on multiply fields
"123456*" AND NOT color: "Blue"
orid:123456*,other-id:223456*
or"(john jon jonathan~) peters*"
– leontalbot
Nov 22 at 15:47
What's the problem? What have you tried? What specifically do you need help with?
– Carcigenicate
Nov 22 at 16:06
And I cannot pass
(into-array (map #(str (name %)) indexed-keys))
toComplexPhraseQueryParser.
which is want I want– leontalbot
Nov 22 at 16:09
Is
MultiFieldQueryParser
aComplexPhraseQueryParser
?– Carcigenicate
Nov 22 at 16:11