Faceted search has a useful idea of search environments. So you can define one search of say forum A for when in forum A as well as a wider search when at home (i.e. a search this forum search).

Another idea I like from faceted search is the option to use a view to display the results. That allows you to also have exposed filters so you can change the sorting on the results but perhaps that is complex to implement.

A taxonomy filter would be useful too.

Comments

jhodgdon’s picture

It is highly unlikely that Search by Page would ever expand to be more like Faceted Search in the near future, but I do like that module a lot...

I think first I will look into whether there is a way to integrate Search by Page into Faceted Search, so that you could just use both modules together rather than trying to reproduce the features of Faceted Search within Search by Page.

The idea would be to be able to set up environments within Faceted Search that used Search by Page indexing rather than core Search indexing. That might be feasible; I'll have to look at the API in Faceted Search to see how to do it (and if it is even possible).

jhodgdon’s picture

Actually, when I think more about this, I am confused as to why you need Search by Page at all, if you want something like Faceted Search.

Faceted search, as far as I can tell, would only really be useful on Nodes, because only Nodes are going to have facets (taxonomy, CCK fields, etc.). The only thing Search by Page would offer in that case is that if you had a keyword search as part of a faceted search environment, you would be able to see keywords that appeared in the theme's rendering of the page, vs. the default node view that core Search indexes. As far as I can tell, that is the only difference, because Faceted Search already allows you to restrict your searching to particular node types.

So can you explain why you cannot just use Faceted Search to take care of your search needs, and why you think Search by Page needs these additional features?

malc_b’s picture

Faceted search does not work with a stemmer. There are 2 issues, the title is search for {key} gave.... and stemmers alter the key so orange become orang. And the same thing applies to the facet current search block. The key gets altered. The option is to not use current search and to theme (somehow) to fix the title. But that loses a lot of functionality and facet search warning on speed is a concern. As I don't want all the faceted search features or can't have them due to the stemmer issue I'm going away from that as an option.

So far I haven't found a search that does all that I'd like. Standard search is confusing. I'd like to re-arrange it and split it into searches on particular node types or paths. So search by page sounds good but that doesn't give the option of multiple search environments. Search config is another similar module, just one search which can be restricted. It seems odd to me that different search environments are not standard as there are on any forum I use, except drupal of course. I'm being to think the only option is the huge curve of making my own form to call search.

BTW - thanks for the quick reply.

jhodgdon’s picture

Ah, that makes some sense.

You might try filing an issue with Faceted Search asking why they cannot work with stemming modules.

Anyway, I will leave this issue here, and consider adding what I think are your main feature ideas:
- Environments - ability to restrict search to specific node types etc. in specific "environments" the way Faceted Search does
- Advanced/faceted searching capabilities, which would probably only apply to searching nodes, and allow restricting by node type, taxonomy, etc.
- Views for displaying search results

malc_b’s picture

Yep, you're correctly summed it.

BTW There already is an issue with faceted search raised quite a while ago (not by me). I've added an issue to porter/stemmer so both modules know about it.

jhodgdon’s picture

You might also consider commenting on the old Faceted Search issue, which will bring it to the top of their issue queue (default sorting is by most recent update).

malc_b’s picture

I have done.

FYI I think I'm getting near to what I want to achieve. I've got

 function mymodule_form_alter(&$form, $form_state, $form_id)

working. I was using the mymodule_form_form_id_alter version but that doesn't give access to the search advanced setting where as the form_alter then switch on form_id does. That allows me to make some changes. And I've got search-result.tpl.php to work too as well as

 function phptemplate_preprocess_search_result(&$vars)

(there seems to be many ways to theme/edit data but not all of them work all the time - type of theme I think).

I'm also using the module search restrict to remove types I do not want to be searchable. And my last is unfortunately a core hack of the search module to make extract work with stemming. See http://drupal.org/node/493270#comment-1714308 .

jhodgdon’s picture

I think about this issue from time to time...

Today I looked in more depth at what it would take to add search environments similar to what Faceted Search does.

Just so I don't forget my conclusions -- it's possible to do:
- Continue to index everything under the main 'search_by_page' "type" in the Search module, because Search needs the "type" to be the same as the module name. That is probably why other search modules in Drupal don't have different "environments". Faceted Search is a bit different, because it doesn't really tie in strongly to the main Search module (it does its own queries, I'm pretty sure).
- Save search settings for the sub-modules on a per-environment basis, and provide an upgrade path from old versions of the module.
- Add some custom permissions for each environment (e.g. role x can search environment y)
- In hook_sbp_paths(), which asks each module what paths to index, the results would include an array of environment IDs for each path (i.e. which environments does this path belong to).
- When searching, we'd only include the paths corresponding to the relevant (and permissioned) environment(s).
- hook_sbp_details() would pass in the environment, because the results could be environment-dependent.
- I don't think hook_sbp_query_modify() would be environmnent-dependent, because the main module would include a condition to restrict to the right environment(s).

jhodgdon’s picture

I think the "Views for displaying search results" idea, however, is not possible. Views can only show either nodes, users, files, etc. -- each view has to be a node type, a user type, a file type, etc. But Search by Page results are basically just URLs on your site, not necessarily nodes. So we can't really use Views to display these search results.

On the other hand, the output is already themeable, so you can override how it's displayed in your theme... I guess that will have to be good enough.

jhodgdon’s picture

Just to let anyone who is watching this issue know, I am working on adding an "environments" feature to Search by Page, and expect to have a development version out in the next few days.

jhodgdon’s picture

Status: Active » Needs review

I have just committed changes to the development version of Search by Page, for these issues:
#662282: Support for multilingual sites
#605458: Search by Page does not return all results
#492878: Multiple search types

Pertinent to this particular issue are Environments features:
- Separate permissions and settings for each search environment
- When you upgrade from a previous version of Search by Page, it takes your settings and makes a new "default" environment

I think it's working fine, and all of my automated tests also pass.

If anyone who's watching this issue wants to test, you can get the development version from CVS, or wait about 24 hours until it's updated on http://drupal.org/project/search_by_page (version 6.x-1.x-dev, but make sure its date/time is after the date/time of this comment here!).

You will need to run the update.php script after updating to this version of the module, and also visit the Search module settings page and tell it to redo the search index.

jhodgdon’s picture

Version: 6.x-1.0 » 6.x-1.x-dev

I just added an update to the 6.x-1.x development version for search environments: You can now specify the name of the tab if you are using this module as a tab in core Search. And you can choose the environment to set as "default" from the main Search by Page settings page.

jhodgdon’s picture

Status: Needs review » Fixed

I'm going to go ahead and mark this fixed. I have some fairly extensive tests for this now and am pretty confident it works. It will be included in the next version of Search by Page (which should be 6.x-1.8), and is already available in the 6.x and 7.x development versions.

As another note, I also added more theming support (and more theming information to the Readme file); see this issue for details:
#706134: Theming support

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.