Re: [ts] Unexpected results using without condition

4 views
Skip to first unread message

Pat Allan

unread,
Jun 12, 2022, 1:43:48 AM6/12/22
to thinkin...@googlegroups.com
Hi Mike,

I’m a little baffled by these results too. Does it work properly if you send through just the single integer value (rather than array):

  MyModel.search(without: {my_integer: 3})

(Of course even if this works, if you’re wanting to pass through arrays of values then it’s not so helpful)

Cheers,

— 
Pat

On 23 May 2022, at 7:17 pm, mikej <mikeje...@gmail.com> wrote:

I’m having some unexpected results:

results = MyModel.search(nil,without: {my_integer: [3]})
results.map(&: my_integer)
[1, 1, 1, 2, 1, 3, 1, 1, 1, 2, 1, 3, 1, 1, 1, 2, 1, 3, 1, 1]

I was expecting:
[1, 1, 1, 2, 1, 1, 1, 1, 2, 1, 1, 1, 1, 2, 1, 1, 1]

ThinkingSphinx::Index.define :my_model, with: :active_record, delta: true do
  …..
  has my_integer
end

Any help greatly appreciated,

Thanks in advance,

Mike


Tried with
Sphinx 2.2.11
thinking-sphinx-4.2.0

And

Sphinx 2.3.3
thinking-sphinx-5.4.0

--
You received this message because you are subscribed to the Google Groups "Thinking Sphinx" group.
To unsubscribe from this group and stop receiving emails from it, send an email to thinking-sphi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/thinking-sphinx/fe62a51b-05fd-4447-bb06-d16c9f74fd5cn%40googlegroups.com.

mikej

unread,
Jul 19, 2022, 7:35:05 AM7/19/22
to Thinking Sphinx
I'm so sorry.  I solved this.  I can't remember how, but I did something daft and I thought I'd deleted this post.  Huge apologies again,
Mike

Reply all
Reply to author
Forward
0 new messages