Problems, need help? Have a tip or advice? Post it here.
8 posts Page 1 of 1
Hi,

I have a search result page (works quite ok) but somehow I can't find a solution for formatting the result. When I type T-shirts in the search box I get this result:
Image

I suppose the - gives me the problem. Is there any way to set couch search to handle T-shirts as one word ?

Other question: can I exclude text boxes in the k_search_excerpt ? with something like ...
<cms:editable name='supplier' label='Supplier' type='text' order='13' searchable='0'></cms:editable>

Last one (for now) .. regarding the new members module : If I don't want to have them in my global site search result must I exclude them with the use of <cms:search masterpage='NOT members/index.php' ...profile.php and so on..>?
I load frameworks and write bugs on top of them, after that I rearrange the code so that it looks like a cool product.
Hi Tom,

The highlighting routine seems to be going a little awry. I'll take a look if this can be rectified.

Other question: can I exclude text boxes in the k_search_excerpt ? with something like ...
<cms:editable name='supplier' label='Supplier' type='text' order='13' searchable='0'></cms:editable>
Would be helpful, I suppose. But, I'm afraid, this option is not available as of now.

If I don't want to have them in my global site search result must I exclude them with the use of <cms:search masterpage='NOT members/index.php' ...profile.php and so on..>?
Well, the member templates *are* ordinary templates.. so they need to be handled the same way as others (i.e. using 'NOT' qualifier with 'masterpage' parameter)
Hello again,

I edited the tags.php file on line 2255 from:

$keywords = str_replace( array(",", "+", "-", "(", ")"), ' ', $keywords );

to:

$keywords = str_replace( array(",", "+", "(", ")"), ' ', $keywords );

This seems to solve the funny formatting when using the search T-shirts. However I don't know if this can be done without creating any problems.

Still looking into excluding <cms:editable /> from search, isn't it possible to set the search_type='to something other than text' like <cms:editable name='supplier' label='Supplier' type='text' order='13' search_type='integer'>? so couch won't set it to text in the db ...? as I understood that only a text value will be used for full text search.
I load frameworks and write bugs on top of them, after that I rearrange the code so that it looks like a cool product.
isn't it possible to set the search_type='to something other than text' like <cms:editable name='supplier' label='Supplier' type='text' order='13' search_type='integer'>?
I am afraid, not. Setting the 'search_type' to integer will throw errors for any non-numeric inputs.

There is, however, a hack for now that you can try -
Couch considers 'textarea' with 'no_xss_check' set to '1' as non-searchable (because usually we use this combo for inputting code).

If you modify the editable region in question to something like this, I think it should do the trick (you'll need to modify contents of existing pages and resave for the persisted values to change)
Code: Select all
<cms:editable name='supplier' label='Supplier' type='textarea' no_xss_check='1' order='13' />
Does this help?
Hi KK,

Setting the 'search_type' to integer will throw errors for any non-numeric inputs.

Yes I noticed that one.

no_xss_check='1' didn't work out for me probably because I use Text field types.

Did some tests by changing tags.php file on lines 1080 and 1085 by adding 'tinytext' to the array and setting as, search_type='tinytext'

This is working, ... only drawback it only saves an integer value. I can't seem to find where in the code this is handled.
I load frameworks and write bugs on top of them, after that I rearrange the code so that it looks like a cool product.
no_xss_check='1' didn't work out for me probably because I use Text field types.
Of course - I did say you need to convert your region to 'textarea'.

I suggest you please convert the text regions to textareas.
If you set the 'height' parameter of textarea, it'll look the same as text and you won't notice any difference.
Hi KK,
KK wrote: Couch considers 'textarea' with 'no_xss_check' set to '1' as non-searchable (because usually we use this combo for inputting code).

Yes there is logic, but I'm doing a school site where html, php, css, js code must be placed in editable regions type textarea with no_xss_check='1'.
Things look good, but the Couch search engine does not work precisely because no_xss_check='1'! This means that no snippet of code can be searched, how can we search even if no_xss_check='1?

In general, things should look like the code posted in this forum. Let me ask what js script you use for code syntax highlighter?
I like prism.js but unfortunately Couch language is not after the maintained ones.

Thanks
orbital wrote: This means that no snippet of code can be searched

Perhaps a workaround can be implemented like this - a second searchable textarea hidden in backend with a copy of the code to make page discoverable.
8 posts Page 1 of 1