Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2020-06-17 06:17:00

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 7,987
Website

Section specific search not working on 4.8.1

Has section specific search stopped working? We used to be able to search for http://www.domain.tld/?m=any&q=query&s=mysection and only get results from that section. Using the query, txp now returns results from all sections.

> Edited to add that the issue also appears on the demo site.

How to reproduce in the demo site:

  1. Create a section called Test
  2. Create a new article and in the body write tutorials and allocate that article in the test section.
  3. The following should have returned just the one article in the test section but it returns both existing articles: https://release-demo.textpattern.co/?m=any&q=tutorials&s=test

> Edit 2: Submitted issue on github

Last edited by colak (2020-06-17 06:39:18)


Yiannis
——————————
neme.org | hblack.net | LABS | State Machines | NeMe @ github | Covid-19; a resource
I do my best editing after I click on the submit button.

Offline

#2 2020-06-17 10:07:18

etc
Developer
Registered: 2010-11-11
Posts: 3,686
Website

Re: Section specific search not working on 4.8.1

colak wrote #323799:

Has section specific search stopped working? We used to be able to search for http://www.domain.tld/?m=any&q=query&s=mysection and only get results from that section. Using the query, txp now returns results from all sections.

Hi Yiannis,

there is no evidence txp search ever worked as you describe. I’ve got an old 4.5.7 site where searching for ?s=etc&q=txp returns the matching articles from all sections. Same on 4.7.2 demo site. Are you sure search filtering by section was ever possible? This said, it sounds logical…

Offline

#3 2020-06-17 11:33:30

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 9,456
Website

Re: Section specific search not working on 4.8.1

etc wrote #323806:

there is no evidence txp search ever worked as you describe.

I was doing some digging and came to the same conclusion…

This said, it sounds logical

… and this conclusion too! It’d be a handy feature, even if the search has to be constructed by hand and we allow context to be passed forward.

The main issue as I see it is that when you construct a txp:search_input tag, the section attribute is already taken to indicate the section upon which you wish the results to land. So we’d need a sections attribute (or something) to indicate which site sections would return results from that tag.

Presumably, this would override any ‘Searchable’ values set when the section is defined from the Sections panel? Or add to it? Or somehow allow you to pick whether it adds to or replaces the built-in Searchable flag.

Whatever we choose, that does give us some nice flexibility to offer ‘advanced’ searches that could search “hidden” (or otherwise unreachable by URL) sections such as, oooh, let’s see, pageless sections perhaps? Thus, you could have a public facing search for visitors but, perhaps if logged in or if you visit a special section, permit a secondary search from the front end for articles that also includes pageless or ‘draft’ sections that you use as a staging area.

If this concept works, could we sneak it into 4.8.2?

Last edited by Bloke (2020-06-17 11:38:00)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Online

#4 2020-06-17 14:29:51

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 7,987
Website

Re: Section specific search not working on 4.8.1

It might have been a construct from Netcarver when he helped us have a common search box for all our installs.

The php and ths js used to do the job. It would be a great feature though:)


Yiannis
——————————
neme.org | hblack.net | LABS | State Machines | NeMe @ github | Covid-19; a resource
I do my best editing after I click on the submit button.

Offline

#5 2020-06-18 14:50:42

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 7,987
Website

Re: Section specific search not working on 4.8.1


Yiannis
——————————
neme.org | hblack.net | LABS | State Machines | NeMe @ github | Covid-19; a resource
I do my best editing after I click on the submit button.

Offline

Board footer

Powered by FluxBB