Results are always the same on each page

13 views
Skip to first unread message

Steve Dierker

unread,
Jul 24, 2012, 12:13:08 PM7/24/12
to thinkin...@googlegroups.com
Hello group,

I'm working with sphinx for first time, so please excuse my lack of experience. I think I have a rather simple question about ThinkingSphinx with Rails.
I've configured my model Projects like this:

define_index do
    indexes :name, :as => :projects
    indexes :text, :as => :description
    indexes file.name, :as => :filenames
    indexes object.name, :as => :objects
    indexes file.proxy.clip_description, :as => :proxy_description

    indexes :archived, :as => :archived
  end

If I know perform a query like this to display all projects in my view:
@projects = Project.search "", :match_mode => :extended
I get according to ThinkingSphinx 121 Results on 7 pages, but if I skip through all my pages, every page is exactly the same with exactly the same 20 projects. 
So is this intended behaviour and I'am doing something wrong? Or did i configure something wrong?
I even have tried to re-index everything and then perform the query, but the result stays the same.
So, anyone any ideas?

thanks,
Steve

Pat Allan

unread,
Jul 24, 2012, 12:17:25 PM7/24/12
to thinkin...@googlegroups.com
Hi Steve

Just to confirm: are you passing through the page parameter to the search call?

Project.search '', :match_mode => :extended, :page => params[:page]

Cheers

--
Pat

> --
> You received this message because you are subscribed to the Google Groups "Thinking Sphinx" group.
> To view this discussion on the web visit https://groups.google.com/d/msg/thinking-sphinx/-/pdxYtWdLDbQJ.
> To post to this group, send email to thinkin...@googlegroups.com.
> To unsubscribe from this group, send email to thinking-sphi...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/thinking-sphinx?hl=en.



Steve Dierker

unread,
Jul 24, 2012, 12:21:00 PM7/24/12
to thinkin...@googlegroups.com

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Pat,

so I the right usage is to perform a search query for each new page you
need while passing in the page parameter?
Because right now its implemented this way in my app:
Request from a live-searchbox via javascript -> perform the query ->
return results -> display all results without pagination in one long list
So I'm guessing I have to increment the results per page parameter a lot
to get everything with one query on one page?

thanks,
Steve

On 07/24/2012 06:17 PM, Pat Allan wrote:
> Hi Steve
>
> Just to confirm: are you passing through the page parameter to the
search call?
>
> Project.search '', :match_mode => :extended, :page => params[:page]
>
> Cheers
>

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJQDstsAAoJEPSIhhOKOJppaTEH/R2PQ+BftMkybvi791fFi8Pl
rQVOPaTqAah5R3VxXz/TJ+ty5bl7yXfIyu6u2UBxMne3BGGrGp2MP9+YbRegevl0
yjx13890tt+BLyQf8fzylnLzOi0Ef4Rkl0elRAH5u8MmQ+SLx2FGiy9wrwW/Imz2
uzP3LXIxtj3i6/sckEoZ9yg8PeVXsOwGObrFMV7XSDl27HvKYKNDR3Dikasq9ada
B40yoNGg3cF4UqRPJTIm+NOx/KvpyZJ9wcEwdOJa6IJG6vjLwBksM4krReYABF/t
7l57wQ8AC4SbLwi0Vk2Q1HfJ41R8omTzD2VqHTUx6kkQ5CvJhpC6h3PwhQlrQ5k=
=jsy2
-----END PGP SIGNATURE-----

Steve Dierker

unread,
Jul 24, 2012, 1:46:06 PM7/24/12
to thinkin...@googlegroups.com

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

So,

I fixed my problem with the ':per_page' option.
Thanks for your help!

Steve
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJQDt9eAAoJEPSIhhOKOJppZHoH/A0fgXlYtV9YTVTq/m448SCa
cE6Oi/N7uvgIi3CymEWRfkz2FL8xgXLkGvIR1Rt7Y8rlaK2KrA3WORKiBBVdcNFo
WO8w4hRqbaP4rr9r+NF2vZ9gDuxKhZjCanBGuKvi8htPra/nW9xp5O+R+b/GUvxl
ozPBtpJpay8rMWouNbKekfv4GLEULWJ0K9Pf5l0vCSoLNIpZJYq9ykMv9yJEDv/e
IutmSZycAQhe3+1tdHCIUHxKb91LOI8bbHhczzr56fDm7O5b5FQ8+vDNWSRI92q9
9iytRJdijqRS3oJ75LWsCBEvYvw6yz+fBbFjFy7aYgPvK78xkNkNfWHafSFOmi0=
=2zsf
-----END PGP SIGNATURE-----

Reply all
Reply to author
Forward
0 new messages