This task is part of #306959: Porting sphinxsearch module to D6 (and Battle Plan).
Post #1 will be holding the draft on how hook_sphinxsearch_api() will work. Next posts may contain updates on progress, ideas, etc. Feel free to chime in if you wish.
This task is part of #306959: Porting sphinxsearch module to D6 (and Battle Plan).
Post #1 will be holding the draft on how hook_sphinxsearch_api() will work. Next posts may contain updates on progress, ideas, etc. Feel free to chime in if you wish.
Comments
Comment #1
markus_petrux commented--- DRAFT ---
hook_sphinxsearch_api() is that little thing that should help us deal with almost any kind of content, and of course, allow external modules extend the default sphinxseacrh module behaviour. We need this to:
- Describe the schema for XMLPipe documents. Status: DONE.
- Generate the data for fields and attributes used to generate XMLPipe documents. Status: DONE.
- Generate the form element for the advanced search page. Status: TODO.
- Parse GET/POST request to convert values into search options. Status: TODO.
- Convert search options into GET arguments. Status: TODO.
- Convert search options into something that can be used to build Sphinx search queries. Status: TODO.
- Define if and how Sphinx document attributes appear in faceted blocks (guided search). Status: TODO.
To be continued...
PS: I'm coding these features in parallell, and then commit to CVS when I feel something is stable enough.
Comment #2
markus_petrux commentedI have commited today the first attempt to implement hook_sphinxsearch_api(). For the moment, it basically works like nodeapi, but applied to what we need here.
Hook operation 'sphinx_schema' and 'sphinx_document' are implemented already. And the XMLPipe generator is using these to build indexes. So that means, we could implement modules that expose node language, workflow attributes, CCK fields, etc. and it all would be indexed automagically. :)
That was the easy part of it. :( lol
I have updated the draft above to include a description about the rest of the things the API should do for us.
Comment #3
ricsonhoo commentedI use this module on my website http://www.yilar.com and like it very much, thank you for your great work.
to make the module more flexible, i suggest to replace sphinxsearch_invoke_api with:
1) module_invoke_all
2)drupal_alter
for function call part:
a. sphinxsearch_xmlpipe_header() modified as follow:
b. function sphinxsearch_xmlpipe_document($main_index_id, $nid) modified as follow
c. function sphinxsearch_generate_xmlpipe_main($main_index_id, $first_nid, $last_nid) change the NODE NIDS QUERY to an alterable way:
for hooks, they will looks like:
example of alter hooks
above idea popup while i am thinking to make customize index and search based on content type.
Comment #4
ricsonhoo commentedgood job!
I am thinking, if blow can be done in one step instead of 3 by changing the search form to GET method?
- Parse GET/POST request to convert values into search options. Status: TODO.
- Convert search options into GET arguments. Status: TODO.
- Convert search options into something that can be used to build Sphinx search queries. Status: TODO.
Comment #5
markus_petrux commentedWell, I do not think I'll have the time to all the things a originally wanted to do here, but I've been spending some time on the queue, and a number of fixes and enhancements have been implemented.
From this POV, this issue is so generic that it seems to me it is better to close it, considering the module should be close to a stable release, at least enough to do some fun with it.