Skip to main content
Topic: total number of search results (prior to pagination)? (Read 4484 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Re: total number of search results (prior to pagination)?

Reply #15

Re: Search

There are a handful of situations where two search <form>s are in the same page (search page), the quicksearch and the advanced search. I'm adding a conditional statement to remove the quicksearch when the advanced is loaded. I'm going to double-check all the semantic markup i've added to make sure everything is pointing to the right <form> under the right condition. Perhaps a little eye-candy for the user here, something like, idk, a faux-quicksearch <form> shrinking on the page until it disappears while the advanced-search <form> expands open.  And of course the real quicksearch <form> will need a transformation reappearing when the user leaves the search-form page. idk it'd be kewl.
Last Edit: May 22, 2017, 08:01:35 pm by Atlas

Re: total number of search results (prior to pagination)?

Reply #16

Re: Search (update)
updated again, i think this includes all instances of two search <form>s
themes/default/index.template.php
Code: [Select]
if((($context['current_action'] == 'search') && (!isset($context['get_topics'][1]))) || (($context['current_action'] == 'search') && (isset($context['did_you_mean']) || empty($context['topics'])))){	
}else{
echo  'HTML for the quicksearch <form>';
}
Last Edit: May 25, 2017, 12:28:08 pm by Atlas

Re: total number of search results (prior to pagination)?

Reply #17

I added a dimension of time to my search results. This is what a cached Search Results Page should look like, methinks. Of course, page 2 would have a different query date and so on, which means you could actually animate search-results browsing in real-time with this design. That's all just bonus though, i like this design because it implies the very nature of a search-results-page, that it is a dated-result that needs to be reevaluated for accuracy.

 

Re: total number of search results (prior to pagination)?

Reply #18

My regex for the query-input pattern property isn't quite right, anyone care to take a hack at it?

view here

Currently, I have this, it says it ignores spaces, accepts input between two and 100 characters, but it also needs to say each space-delimited word must be two characters long.
Code: [Select]
/[^\s]{2,100}$/
Last Edit: May 25, 2017, 01:39:26 am by Atlas

Re: total number of search results (prior to pagination)?

Reply #19

A bit more details may help, it may be it's quite late at night, but I'm not sure what you want to do, sorry... :(
Bugs creator.
Features destroyer.
Template killer.

Re: total number of search results (prior to pagination)?

Reply #20

It's not critical or anything, just my perfectionism showing.

I'll explain though, schema.org offers a feature to annotate <form> elements with constraints for the expected values.
So the SearchAction's query property contains our search-term, and the query-input property contains the annotation.

Here's the annotation thus far.
Code: [Select]
<span property="schema:query-input" typeof="schema:PropertyValueSpecification">
     <meta property="schema:valueName" content="search" />
     <meta property="schema:valuePattern" content="/[^\s]{2,100}$/" />
     <meta property="schema:valueMinLength" content="2" />
     <meta property="schema:valueMaxLength" content="100" />
     <link property="schema:valueRequired" href="http://schema.org/True" />
     <link property="schema:multipleValues" href="http://schema.org/True" />
</span>

Note the valuePattern property, this value is a regular expression pattern for "search=term".  Currently, my regex states the <input name="search" /> accepts 2-100 characters and ignores spaces. For this to be more accurate, it should state that it accepts 2-100 characters, ignores spaces but each "word" needs to be at least 2 characters long.

The corrected regex should match like so:
t - no match
th 1 match
th r 1 match 1 fail
th re 2 matches


On Second Thought

Nevermind, i was way too focused on that regex that i didn't consider the multipleValues=true accomplishes what i intended in concert with the existing regex. So i was right and thought i was wrong and now it's all nevermind.
Last Edit: May 25, 2017, 05:33:14 am by Atlas