Closed (fixed)
Project:
Search API ajax
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
15 Nov 2011 at 00:40 UTC
Updated:
16 Jul 2012 at 03:11 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
Anonymous (not verified) commentedI have it working with Facet API without issues. The Search API facet links aren't any different. So if you had it working with olds Facets, there is no reason it would stop working. What other things did you change?
Comment #2
Anonymous (not verified) commentedComment #3
scotjam commentedI've not changed anything other than uninstall old facets, then install and configure new facets, and add facet blocks to theme.
here's my facet link with the old facet module... which works for me
http://example.com/search/quis?filter[author%3Aname][0]=%22Anonymous%22and the html...
<ul class="search-api-facets"><li class="first"><a href="/search/quis?filter[author%3Aname][0]=%22Anonymous%22" class="search-api-facet-value active">Anonymous</a> <span class="search-api-facet-count">(9)</span></li><li><a href="/search/quis?filter[author%3Aname][0]=%22admin%22" class="search-api-facet-value active">admin</a> <span class="search-api-facet-count">(6)</span></li><li><a href="/search/quis?filter[author%3Aname][0]=%22hefritrocrip%22" class="search-api-facet-value active">hefritrocrip</a> <span class="search-api-facet-count">(4)</span></li><li><a href="/search/quis?filter[author%3Aname][0]=%22thatridrob%22" class="search-api-facet-value active">thatridrob</a> <span class="search-api-facet-count">(4)</span></li><li><a href="/search/quis?filter[author%3Aname][0]=%22jithawech%22" class="search-api-facet-value active">jithawech</a> <span class="search-api-facet-count">(3)</span></li><li class="last"><a href="/search/quis?filter[author%3Aname][0]=%22swesedidrina%22" class="search-api-facet-value active">swesedidrina</a> <span class="search-api-facet-count">(2)</span></li></ul>here's with the new facet module... which doesn't work for me
http://example.com/search/quis?f[0]=author%253Aname%3AAnonymoushere's the html...
<ul class="facetapi-facetapi-links facetapi-facet-authorname facetapi-processed" id="facetapi-facet-search-apiapache-solr-index-block-authorname"><li class="leaf first"><a href="/search/quis?f[0]=author%253Aname%3AAnonymous" class="facetapi-inactive">Anonymous (9)</a></li><li class="leaf"><a href="/search/quis?f[0]=author%253Aname%3Aadmin" class="facetapi-inactive">admin (6)</a></li><li class="leaf"><a href="/search/quis?f[0]=author%253Aname%3Ahefritrocrip" class="facetapi-inactive">hefritrocrip (4)</a></li><li class="leaf"><a href="/search/quis?f[0]=author%253Aname%3Athatridrob" class="facetapi-inactive">thatridrob (4)</a></li><li class="leaf"><a href="/search/quis?f[0]=author%253Aname%3Ajithawech" class="facetapi-inactive">jithawech (3)</a></li><li class="leaf last"><a href="/search/quis?f[0]=author%253Aname%3Aswesedidrina" class="facetapi-inactive">swesedidrina (2)</a></li></ul>happy to provide more info as needed, can you advise what I should look out for?
Comment #4
scotjam commentedI can confirm that I don't make any other changes other than switching from old facets to new facets.
I've tried this a few times now, making no other changes other than switching from old facets to new facets and back again, but still get the same problem.
The facet URLs do look different with the new facets and the HTML around them using different classes. It might not be a bug though, any support appreciated.
Comment #5
Anonymous (not verified) commentedOk, I dont't know yet. One possibility is that the block ID's or classes have changed, and search_api_ajax.js no longer "sees" the right blocks to trigger the ajax link. You might have to debug the JS near
Drupal.search_api_ajax.ajax = function(selector) {and see why the links aren't triggered anymore. Hard to tell. It's still working for me after I switched.Comment #6
scotjam commentedLooks like the page is refreshing well before this line, as mentioned above.
I'm not clued up on javascript, so can you point me to where the browser is asked to do something when a link is clicked?
Comment #7
scotjam commentedUpdate...
I've added a sort block and that works, but the facet blocks still don't.
In search_api_ajax.js using firebug, I've noticed that in the code where it says...
blocks only contains...
Object { search_api_sorts_search-sorts="#block-search-api-sorts-search-sorts"}Should it have more, say one for each of the facet blocks?
The other blocks have ID's like...
'#block-facetapi-vrsb2bszzhm2kr6izoivsltv5wnqlu6t'
'#block-facetapi-3mxxejvq-3sriok3j3i48prrfv59epsd'
'#block-facetapi-z1tv-nxxqmsdj31owsqglqgcjovjjk7k'
Any ideas on what next steps to take to debug?
What's interesting is that sorts block works, so the regions are okay. For some reason facet blocks don't get picked up.
You can probably tell I am clutching at straws :)
Comment #8
Anonymous (not verified) commentedYes indeed, it should have all the facet blocks in "var blocks".
I thought I added them in the latest devx of the search api AJAX module? Which version are you using exactly?
For example in search_api_ajax_modules() it should show them:
Comment #9
scotjam commentedI'm using the latest dev version on the project page, dated September the 8th.
It does have that bit of code in the file you mention.
But it doesn't have the facetapi lines...
I'll add them in and try again.
Comment #10
Anonymous (not verified) commentedDamn, in that case I must be running way behind with my updates. I thought I pushed this through already. I have check my changes and will post a patch here soon!
Comment #11
Anonymous (not verified) commentedHere is a patch with my latest work on the module,
- includes update for facetapi
- includes updates for Views and taxonomy paths
Comment #12
scotjam commentedThanks for the helps on this. This is weird, now nothing works as ajax :( I'm assuming nothing is wrong with your patch because it works for you. So the problem is my attempt at patching the files. I've tried to apply the patch a few times but as I don't have any patching software I'm trying to do it manually, attached. Will you get a chance to commit the patch any time soon?
Comment #13
Anonymous (not verified) commentedAttached a full update. Can you please try it? (after flushing Drupal cache)
And let me know what happens.
Comment #14
scotjam commentedThank for that. I'm trying this out with Bartik and with Omega themes, and changing the regions etc to match.
With Bartik, the ajax spinner triggers, the url changes, but the page refreshes instead of ajax refresh. With Omega, the page dims, scrolls up, but no spinner appears, and that's it.
At what point should I give up :)
Comment #15
stopshinal commented@ morning time - does this work with views?
Comment #16
Anonymous (not verified) commentedYes I have it working with Views, Views panes on Panel pages and even Taxonomy/term/% pages. But maybe I broke a lot of stuff trying to achieve all this... Early december I have time to do a proper review and stabilize the work.
Comment #17
mrfelton commentedSeems to work very well. I'm using it with Views. However I did find that if you set a views page path to be the site's homepage, then it no longer works.
Comment #18
mrfelton commentedAlso, there is no ajax when removing a facet - only when adding new ones.
Comment #19
scotjam commentedThis is interesting...
With views, everything works right. selecting facets and unselecting them results in ajax update of the view. The exposed form search query isn't set to auto-update the view, but I'm guessing that's because it not implemented. So, really, this works fine for me. I'll continue to explore more and feedback any thing that might be useful.
Without views, it doesn't work, for me anyway. I don't know that's because its only supposed to work with views. My previous comments have been from the perspective of not using any views and just using the search api search pages. So, is this expected? or should this module work with and without views?
Hope this helps.
Comment #20
Anonymous (not verified) commentedYeah the patch breaks the search api pages... So I have to go back to the drawing board.
To work with exposed Fulltext filter in views, I created a custom block with a form with id "keys". The views exposed filter is renamed to "query" so you get /myview?query=Keys. That should work.
Anyway, this patch needs more work to fix the Search Pages.
Comment #21
uditmahajan commentedIts not working for me too... I have a view page created on my Search Index. Facets blocks and everything is shown perfectly fine but the spinner does not disappear. Perhaps I am doing something wrong here?
I also patched my search_api_db (http://drupal.org/node/1390586#comment-5443010) and search_api (http://drupal.org/node/1390598#comment-5443016) with Damien Tournoud patches for supporting the "OR" operator. Could that be the problem here?
I also found out that my spinner continues to spin because an error is returned by the AJAX callback (Drupal.search_api_ajax.response_callback at line 89 in search_api_ajax.js), but there is no error callback defined. Some of the data is returned but with error. I even tried to debug but no exception or error was thrown there.
@ morning time - Any idea? I am trying to understand the code, perhaps you could give me some pointers here so I can get a head start. I would even love to contribute to this module as I am requiring this functionality heavily in my upcoming venture.
Comment #22
jaxxham commentedHi, I'm not having any luck with this module either - using Search API and Facets API. I also did something with my custom module that drove my server bonkers (CPU was over 500% - must've made some mistake with Ajax...). Are there any updates coming for this module?
Thanks!
Comment #23
uditmahajan commentedOkay, I found the problem. It was more of a access callback issue then anything else. I am trying to streamline it to match the actual access on the page/view (rather than hard-coding it).
One problem I found that facet remove links do not support ajax. Again a simple javascript fix will do.
If i am able to fix all this, I will try and upload a patch.
Comment #24
118218 commentedCan you help me run this module?
Here are my issues:
Before the patch in # 13
1) I can not do a search using the search box of views. Nothing happens! (Enter or click)
2) The sorting works, but not the facets. The facets load new pages.
3) Only works when I'm logged in admin.
After the patch in # 13
1) I still can not use the search box of views
2) The sorting does not work, the spinner starts but keeps running. Same for the facets.
Any idea? I use the theme Bartik and the example you provide in Search Api ajax page.
Comment #25
bianchie commentedsubscribing
Comment #26
mitch albert commentedsubscribing
Comment #27
cviccaro commentedI've been able to get this working on my D7 site using search api, facet api, running on solr backend. Had to do some dsm's and console.log's in each of the respective ajax files (.module and .js) to figure out why it was not working, but ultimately found the culprit to be modified block ID's that were not matching the ones stored in the system, so the search_api_ajax module was not able to locate any of the links. After I fixed this, it is working.
Working example here: http://www.jpecatalogs.com/search
Couple bugs to note, is when you kill a filter (hit the minus) it can (usually does) returns a page as if there is no search query.
My custom code is extremely simple:
Comment #28
cviccaro commentedUpdate on previous comment, I got the "minus" filter working. In search_api_ajax.js, function Drupal.search_api_ajax.navigate (starts @ line 118), change function
FROM:
TO:
*Note*: Not sure how it will fair with multiple filters being enabled, and using the (-) on just one. Should work since the "url" var won't be undefined, though.
Comment #29
meji15 commented@cviccaro: What version did you use to get it working? Is it the origianl dev version (2011-Sep-08) or the patched on at #13?
Comment #30
jsacksick commentedI took the patch from #10 and did some modifications.
I tried with views + facetapi and it worked after those modifications.
Now, it also works with the checkbox widget of facetapi (I had to unbind the facetapi click event attached to the checkbox and I replaced it with a custom event.)
At the very end of the
search_api_ajax.pages.incmodule there were a call tocontext_get_contextswithout theif (module_exists('context'))verification and causes an infinite ajax loading. Besides that verification, I'm not sure this line alone is really useful, So I removed it.I also used drupal_http_header instead of header + replaced print json_encode by drupal_json_encode, and I think that's almost it ... We need to move on this issue maybe merge the patch and create other issues If we still have but this patch is a really great progress.
Comment #31
Anonymous (not verified) commentedThanks so much, jsacksick! Will review this very soon, after I take a good look at it. Thanks again,
Comment #32
Anonymous (not verified) commentedBy the way, the context lines are needed if you show Blocks through the Context module. Otherwise these blocks don't show up in the AJAX JSON (Drupal doesn't know about them). So I will add those lines back in, with module_exists() of course
Comment #33
multpix commentedoriginal dev and #30 with Facet API works for me
thanks jsacksick,
thanks morningtime
but search_api_ranges has stopped working
peace
Comment #34
jsacksick commentedAs a possible improvement, I think we can replace the delivery callback of menu items and use this instead http://api.drupal.org/api/drupal/includes!ajax.inc/function/ajax_deliver/7
Comment #35
Anonymous (not verified) commented@multipix I'll do some work on the ranges. There is an upcoming Prett Facet Paths integration, so will also update the AJAX to work with pretty paths.
Comment #36
Anonymous (not verified) commentedOk, for now, I just wanted to get this major patch working. I've been testing extensively and it looks really good. Since the current devx was broke, I decided to go ahead and commit this. Full patch attached. The attached patch includes and updated jquery.livequery.js to latest version, which has performance improvements, not really functional changes. And some code formatting/cleanup.
Thanks for all your work and feedback @jsacksick, @multipix
We can open new issues for improvements! Thanks so far.
Committed to devx,
http://drupalcode.org/project/search_api_ajax.git/commit/dff04a8