Hi, You're right.I've put my field in "text_general" type and i found the problem. For example, i have this like a index : london, , ,capital, , ,populous,city, ,united,kingdom When i mock like this :clauses[0] = new SpanTermQuery(new Term("details", "populous"));clauses[1] = new SpanTermQuery(new Term("details", "city"));--> i found the document But, like this : clauses[0] = new SpanTermQuery(new Term("details", "capital"));clauses[1] = new SpanTermQuery(new Term("details", "city"));--> i didn't found the document My question are :- How to configure solr to found document this this second mocked parameter?- How to configure solr to ignore the order of the parameter? Thanks in advance. Regards.Andry
Le Dimanche 14 juin 2015 16h33, Jack Krupansky <jack.krupan...@gmail.com> a écrit : Why don't you take a step back and tell us what you are really trying to do. Try using a normal Solr query parser first, to verify that the data is analyzed as expected. Did you try using the surround query parser? It supports span queries. Your span query appears to require that the two terms appear in order and with no more than one other term between them, but your data has more than one term between them, so of course that will not match. You can simulate a span query using sloppy phrases in the normal Solr query parsers: "london city"~10. The only catch is that does not require that the terms be in that order. -- Jack Krupansky On Sun, Jun 14, 2015 at 6:45 AM, Test Test <andymish...@yahoo.fr> wrote: > Re, > Thanks for your reply. > I mock my parser like this : > @Overridepublic Query parse() { SpanQuery[] clauses = new > SpanQuery[2]; clauses[0] = new SpanTermQuery(new Term("details", > "london")); clauses[1] = new SpanTermQuery(new Term("details", > "city")); return new SpanNearQuery(clauses, 1, true); } > Thus i have a query like this spanNear([details:london, details:city], 1, > true) > If i do for example spanNear([details:london], 1, true) > or spanNear([details:city], 1, true) i get my document.I have already add > the parameter q.op = "OR", it doesn't work. > > > > Le Samedi 13 juin 2015 17h21, Jack Krupansky < > jack.krupan...@gmail.com> a écrit : > > > What does does your exact query parameter look like? The parentheses in > your message make it unclear. > > You have a comma in your query as if you expect this has some functional > purpose. Technically, it should get analyzed away, but why did you include > it? > > Do any queries find that document, or do all other queries find it and only > this one fails to find it? > > Are you sure that you committed the document? > > Does a query by id find the document? > > Does your <field> for details have indexed="TRUE"? > > > -- Jack Krupansky > > On Sat, Jun 13, 2015 at 5:54 AM, Test Test <andymish...@yahoo.fr> wrote: > > > Hi, > > I have solr document, composed like this, with 2 fields : id = 1details = > > "London is the capital and most-populous city of United Kingdom." > > When i request solr with this parameter (details:london, details:city), i > > don't get the document.The "details" field is a type "text_general" > > <fieldType name="text_general" class="solr.TextField" > > positionIncrementGap="100"> <analyzer type="index"> > > <tokenizer class="solr.StandardTokenizerFactory"/> <filter > > class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" /> > > <!-- in this example, we will only use synonyms at query time > > <filter class="solr.SynonymFilterFactory" > > synonyms="index_synonyms.txt" ignoreCase="true" expand="false"/> > > --> <filter class="solr.LowerCaseFilterFactory"/> > > </analyzer> <analyzer type="query"> <tokenizer > > class="solr.StandardTokenizerFactory"/> <filter > > class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" /> > > <filter class="solr.SynonymFilterFactory" > synonyms="synonyms.txt" > > ignoreCase="true" expand="true"/> <filter > > class="solr.LowerCaseFilterFactory"/> </analyzer> </fieldType> > > What's wrong? > > > >