This is a patch allowing Nodewords to be used with the default Search and SuperSearch; it removes existing bugs in the indexation hook for meta keywords. It works for most meta tags provided by this module.

CommentFileSizeAuthor
#21 nodewords_090001.patch4.96 KBavpaderno
nodewords.patch1008 bytes63reasons-YP

Comments

63reasons-YP’s picture

Status: Fixed » Reviewed & tested by the community
MisterSpeed’s picture

Status: Reviewed & tested by the community » Needs review
avpaderno’s picture

Title: Patch allowing Nodewords to be used with the default search.module and SuperSearch » nodewords_nodeapi('update index') is bugged
Version: 6.x-1.3-beta5 » 6.x-1.x-dev
Assigned: 63reasons-YP » Unassigned
Status: Needs review » Active

Thanks for pointing this out.

Unfortunately, the full code in nodewords_nodeapi('update index') needs to be changed, and made more similar to the code present in nodewords_get_tags().
The code should call <meta_tag_handler>_prepare(), which is responsible to return the actual content of the meta tag; it also needs to take in consideration the weight associated to each meta tags.

I am already working to resolve this problem.

avpaderno’s picture

Status: Active » Fixed

The code has been changed, and committed in CVS.

Thanks again for your report, and your help.

63reasons-YP’s picture

I am always happy to help.

63reasons-YP’s picture

I had test last dev version (Nov.14) of the module, it doesn't work for me in "indexing feature".
And module output warnings, when it is enable.

avpaderno’s picture

Status: Fixed » Postponed (maintainer needs more info)

which warnings messages do you see?

63reasons-YP’s picture

I see warnings that discribed this: #632856: Error with version_compare().

avpaderno’s picture

Status: Postponed (maintainer needs more info) » Active
63reasons-YP’s picture

I don't understand, is "indexing feature" pb resolved (becouse i see another code in dev version, then in beta5, but it not work for me)?

Zalatar’s picture

Kiam,
Can you tell me if this issue of "Search" not indexing nodewords has been fixed?
And what release was this fixed in?

I am still having issues with this.

Thanks for all your hard work on this module. It is appreciated.

Z

avpaderno’s picture

Title: nodewords_nodeapi('update index') is bugged » Meta tags content is not indexed from the search module

I am changing the title to make it clearer.

In the next days I will verify if effectively the meta tags content is not indexed.

avpaderno’s picture

I marked #638900: Is search indexing nodewords? as duplicate of this report.

ilo’s picture

Status: Active » Needs review

KiamLaLuno, could you please review this code? this is from current latest version, the hook_nodeapi(update index):

    case 'update index':
      $tags = array();
      $tag_options = array(
        'type' => NODEWORDS_TYPE_NODE,
        'ids' => array($node->nid),
      );

      if (isset($node->nodewords)) {
        // Prepare the tags.
        foreach (nodewords_get_possible_tags() as $name => $info) {
          $bool = (
            !empty($info['tag:template:index']) &&
            function_exists($function = $info['tag:function:prefix'] . '_prepare')
          );

          if ($bool) {
            $tag_options['parameters'] = !empty($info['tag:function:parameters']) ? $info['tag:function:parameters'] : array();

            $function(
              $output_tags,
              isset($node->nodewords[$name]) ? $node->nodewords[$name] : array(),
              $tag_options
            );
          }
        }

        $output = nodewords_output_tags($tags, 'update index');

Just realized that $output is built upong the $tags variable content, but this variable is not updated within the foreach scope, so it ends being an empty array.. Is some code missing to get data into $tags from $output_tags?

Does nodewords_output_tags return valid information for 'update index' operation? I'd say it is returning HTML, where indexing should use plaintext, and single words.

avpaderno’s picture

The correct variable name is $tags; I copied the code from a different function, which used $output_tags.

I already changed both the functions to use $tags, but I still have to commit it in CVS. Before to commit the code, I will add some options more for the custom pages (a.k.a. other pages). I have already added an option to let the user decide if the passed path must be checked agains the path alias of the currently shown page; I will also add an option that allow to use a more generic path that includes also parameters, and anchors.

ilo’s picture

oh, these are good news.. well.. I guess.. I still can't find the added value in searching node using keywords.. can anyone explain me that?

avpaderno’s picture

I still can't find the added value in searching node using keywords

It is useful to find a node by keywords as it is searching a node by taxonomy terms (taxonomy.module implements hook_nodeapi() too). I agree that searching by keywords seems redundant with searching by taxonomy terms, but I can understand if somebody would prefer to use differently keywords, and taxonomy terms.

ilo’s picture

if somebody would prefer to use differently keywords, and taxonomy terms.

This feature can easily work if nodewords use a custom vocabulary while node tagging is done with another. User can search using taxonomy and nodewords vocabularies for that.

From my pov, I can tell, I've found annoying that I'm searching the word 'test', and a node is listed in the search but test string is not anywhere in the node.. This feature to acceptable from UX should have:
- permissions to search nodes using nodewords terms.
- mark a result of the search as 'search string found in meta tags' because results would be confusing, or separate search in other tab.
Otherwise it will turn into a magic hidden feature, that btw is not documented anywhere :)

Anyway, as I said, this could be done using two taxonomies in case a user would prefer to have different terms for node tags and meta tags.

avpaderno’s picture

From my pov, I can tell, I've found annoying that I'm searching the word 'test', and a node is listed in the search but test string is not anywhere in the node..

That is true also for comment.module, which implements hook_nodeapi('update index'). It is true that normally comments are shown after the node, but in some cases that is not true.
If the searched text should be visible in the node page, IMO, there would not be a reason to allow modules to implement hook_nodeapi('update index'). I agree that the feature should be documented in the file README.txt.
Maybe the meta tags edit form should report which meta tags are indexed.

avpaderno’s picture

Status: Needs review » Fixed
StatusFileSize
new4.96 KB

I fixed the problem. The attached file is the patch for the last changes in the code.

ilo’s picture

I've committed (294422) a testcase to verify this issue.

Zalatar’s picture

I have applied the new module and indexing appears to be working at this time. Yea!!
Thank you Kiam!
I will have more time tomorrow to test it further.

Z

bartezz’s picture

subscribe

Status: Fixed » Closed (fixed)

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

bartezz’s picture

Was this comitted to 6.x-1.8? I've just updated to this version, reindexed site and ran cron but search won't find the node by keywords I've added to meta description or meta keywords...

Cheers

gpk’s picture

Per #21 and #22 this has been fixed and relevant test cases also built in to the module. Those changes were committed end November and 1.8 came out 10 Dec so it should be working. Perhaps more than 1 cron run was needed to completely reindex the site.

Balbo’s picture

Version: 6.x-1.x-dev » 6.x-1.8
Category: bug » support
Status: Closed (fixed) » Active

Is there a way to prevent metatags to be indexed for internal search? I don't like people finding nodes that do not contain the words they did look for.

dave reid’s picture

Status: Active » Fixed

There is no more search-related code in the module. It should be a separate module or sub-module if enough people want meta tags added to search indexes.

Status: Fixed » Closed (fixed)

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