Hello,

First, thanks for sharing this module. I have some pages which are made almost entirely from views (as blocks), so I think this is just the search module I need.

I have problems configuring the settings, though.
I have created a search environment and added a path to one of those pages made form views. I've made sure that the site is 100% indexed, but still the results insist on linking to the node of the content rather than the page.
Further, I have added some text for the 'Snippet' field for the path, but this doesn't show up in the results.

I think I must be missing something, but it seems to me I've set it all up correctly - so I just don't know how to proceed from here.

Any tips or suggestions much appreciated!
-Tobias

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jhodgdon’s picture

Hm. I think I need more information to understand what you are doing...

a) Are you searching from the search page that Search by Page sets up for your environment, or using the site-wide Search form?

b) You mentioned "linking to the node of the content rather than the page"... I do not know what you mean by this. What is the URL of the node vs. the URL of the page?

Maybe you can take screen shots of, or describe:
1. Your Search by Page environment setup page (click "edit" on the environment).
2. Your Search by Page Paths admin page showing any custom paths you set up.
3. A page made of blocks that you are trying to search.
4. The search results page when you search for some of the words that are on that page.

Tobias Jonch’s picture

FileSize
20.49 KB
39.28 KB
49.17 KB
52.49 KB

Hi jhodgdon, thanks for taking the time :-)

a) I have tried both, with the same results. I can tell from the url that Search By Page is being used (www.mysite.com/search/search_by_page/mysearchterm)

b) What I mean is that it links to the single piece of content where it found the term. Say it found the term in node/10, it will then link to that, rather than the page where the node is displayed (through a view).
I figure that's (part of) the idea of listing the path - so it knows which url to link the result to?

1) SBP settings.jpg. Figure the rest doesn't matter.
2) SBP Path.jpg
3) SBP page searched.jpg. This is from mysite.com/processer
4) SBP results.jpg. The result links to node/43, which is the nid for the 'static box' content.

Thanks again! :-)

jhodgdon’s picture

Title: General configuration » General configuration question

Hm... So it sounds like you have two problems here:
a) The "static box" page node/43 is showing in search results.
b) The "processer" page is not showing up in search results.

For (a), you should probably either turn off Search by Page Nodes, or at least exclude the content type that node/43 is.... that assumes that (hopefully!) you have set up your site so that you have a special "static box" content type for your small boxes, and you are not using the generic "Page" or "Article" content type for these special little boxes of content. If you haven't set up your site that way, you might want to consider doing it, or you will not be able to take care of (a).

For (b)... The problem could be in how the page is constructed. If the page is built with Panels, then there is a good chance that the content on the page is not in the "main content" region of your theme, in which case Search by Page will not index it. See #1587860: Support Panels pages (with a sub-module) for a discussion of that problem... which I probably should give some attention to solving!

You can see what Search by Page put into the search index for this "processer" page by looking in the database, if you are feeling brave and/or you are a developer. If you're not conversant with the database, find "PHPMyAdmin" in your site hosting control panel, open up your database, and click on the "SQL" tab to run queries.

First, you will need to look in the table called "sbp_path", and find the row that has "processer" in the "page_path" column:

SELECT * FROM sbp_path WHERE page_path = 'processer';

(if you have a database prefix, you will need to change the FROM table name accordingly). Find the "pid" value from that database table row.

Then go to the "search_dataset" table, and do this query -- assuming 12345 is the "pid" value you found in the last query:

SELECT * FROM search_dataset WHERE sid=12345 AND type = 'search_by_page';

Or you can combine the two queries and go directly to this query:

SELECT d.* FROM search_dataset d LEFT JOIN sbp_path p ON d.sid=p.pid WHERE d.type = 'search_by_page' AND p.page_path = 'processer';

In either case, the "data" column of the result will show you what Search by Page put into the search index. Hopefully that will give you some information about what is happening...

Tobias Jonch’s picture

Many thanks for taking the time to help me jhodgdon! :-)

I've had another problem with the basic set-up of my pages (though I do use content types for the various elements on the page), and so I've changed quite a few things around over the past few days.

Suffice it to say that the module is now working perfectly!

Unfortunately I've deleted most of the old content and types, so I can't really tell what exactly the problem was. I feel bad about that - least I could have done was provide some kind of closure or explanation for this. But it was very likely my noobly set-up of the pages that caused the problem.

Thanks again for your time and a great module!

jhodgdon’s picture

Status: Active » Fixed

Glad it's working!

Status: Fixed » Closed (fixed)

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