I''m trying to do a search that would exclude a value from it and return whatever results aren''t matched from the term, but it''s not working very well. None of these are working, they all return the results including the ones with tag_id = 701 tag_id:(NOT 701) tag_id:(! 701) tag_id:(- 701) But if I go the other way around it works (which I don''t want since I have thousands of tags): tag_id:(1 OR 2, etc...) Any thoughts? -- Posted via http://www.ruby-forum.com/.
On Tue, Aug 29, 2006 at 02:27:18AM +0200, Thiago wrote:> I''m trying to do a search that would exclude a value from it and return > whatever results aren''t matched from the term, but it''s not working very > well. > > None of these are working, they all return the results including the > ones with tag_id = 701 > > tag_id:(NOT 701) > tag_id:(! 701) > tag_id:(- 701)a Query that only has one negative (must not) term is not possible, I believe. That''s because of how the index works internally, I think. Probabla such a query would require a full scan of the index, which is something you usually don''t want to happen. Jens -- webit! Gesellschaft f?r neue Medien mbH www.webit.de Dipl.-Wirtschaftsingenieur Jens Kr?mer kraemer at webit.de Schnorrstra?e 76 Tel +49 351 46766 0 D-01069 Dresden Fax +49 351 46766 66
On 8/29/06, Jens Kraemer <kraemer at webit.de> wrote:> On Tue, Aug 29, 2006 at 02:27:18AM +0200, Thiago wrote: > > I''m trying to do a search that would exclude a value from it and return > > whatever results aren''t matched from the term, but it''s not working very > > well. > > > > None of these are working, they all return the results including the > > ones with tag_id = 701 > > > > tag_id:(NOT 701) > > tag_id:(! 701) > > tag_id:(- 701) > > a Query that only has one negative (must not) term is not possible, I > believe. That''s because of how the index works internally, I think. > Probabla such a query would require a full scan of the index, which is > something you usually don''t want to happen. > > JensThat is correct. Single negatives won''t work. You could try this; tag_id:(* AND NOT 701)