Hi Martin...
All is well here! Very busy with my main site growing rapidly right now.
Still I'll be glad to getting back to getting out and doing things again! :)
This is the results I get with my system:
line: pink elephant
1. [(query page={p} text="pink")] Yes
2. [(query page={p} #1(,)pink)] No
3. [(query page={p} #1(+)pink)] Yes
The (,) fails because it only works on comma separate values, the + does a
simple string search. The text option seems to work for me, but I have this
line updated in my script as discussed farther down in this thread:
function BOLTqueryText3($find, $args) {
## THIS ONE TAKES CARE OF ! AND DOES ACTUAL CHECK
global $tempSearchArray;
if ($args['case'] != 'true') $find = strtolower($find);
if ($args['words'] !== 'false') $s= " ";
else $s = "<>";
$tf = true;
if (substr($find, 0, 1) == "!") {
$tf = false;
$find = trim(substr($find, 1));
}
if (substr($find, -1) == '*') $find = substr($find, 0, -1);
foreach($tempSearchArray as $page => $p) {
$line = explode(':', $p);
$check = $s . $line[0] . $s;
if ($args['case'] != 'true') $check = strtolower($check);
if ($tf === true && preg_match("/\b($find)\b/ie", $check) != 0)
$search[] = $page;
elseif($tf === false && preg_match("/\b($find)\b/ie", $check)
== 0) $search[] = $page;
}
return $search;
}
I haven't done a release since doing that fix, so the current download has
not yet been corrected.
I'm actually working on a pretty big release but I'm right in the middle of
several new features and it's awkward to do a release midstream like this.
I'm learning more towards a 7.x version at this point as it has been over a
year.
Can you check to see if you have the function above in library.php updated?
I could download and upload 6.02 with that one fix, but with so many other
fixes in my script, I think it's better to wait and just do a big release
in the near future.
Let me know...
Cheers,
Dan
PS. I'm inclined to get rid of the text= link= options as they are
specialized rules whereas the query operators are far more powerful and
flexible. I did check the search action as well, and it worked for me. But
you do have to have the correct index populated with data. I store my
indexes in special content files rather than the default index pages, so I
had to adjust the search function to query the correct page...
On Fri, Apr 24, 2020 at 10:51 AM mz <[email protected]> wrote:
> index.site has this line: test: pink elephant
>
> I tried:
> query page=index.site text="pink elephant" fmt ...
> query page=index.site #1(,)pink -> that works
>
> Maybe this is the cause that action.search does not work either.
>
> Am Freitag, 24. April 2020 16:32:50 UTC+2 schrieb mz:
>>
>> Hi Dan
>> I hope you are well.
>> It seems that this bug is still in the download file.
>> Even after doing the fixes, query text= does not work for me.
>>
>> Greetings, Martin
>>
>> Am Mittwoch, 2. Oktober 2019 15:11:14 UTC+2 schrieb Dan:
>>>
>>> Thanks for checking into this. I don't really use this much so it really
>>> helps to have someone assist with the debugging.
>>>
>>> Looks like there was a small typo in the library.php file. Probably
>>> introduced when I went to better word matching patterns and away from
>>> simple string matching. You can see a few commented out lines in yours.
>>>
>>> Anyway, pretty easy to fix. I actually edited a few other little things
>>> in this function to strengthen it but the main problem was a $t instead of
>>> a $tf variable in the next to last line of code. Oops.
>>>
>>> The best thing to do is open up library.php and replace the function
>>> below with the following code. On my version its line 1630 but yours might
>>> be different as this is off my version which has several updates built in.
>>> I'll try and go ahead and release another upgrade sometime soon that
>>> incorporates these fixes. :)
>>>
>>> Cheers,
>>> Dan
>>>
>>>
>>> function BOLTqueryText3($find, $args) {
>>> ## THIS ONE TAKES CARE OF ! AND DOES ACTUAL CHECK
>>> global $tempSearchArray;
>>> if ($args['case'] != 'true') $find = strtolower($find);
>>> if ($args['words'] !== 'false') $s= " ";
>>> else $s = "<>";
>>> $tf = true;
>>> if (substr($find, 0, 1) == "!") {
>>> $tf = false;
>>> $find = trim(substr($find, 1));
>>> }
>>> if (substr($find, -1) == '*') $find = substr($find, 0, -1);
>>> foreach($tempSearchArray as $page => $p) {
>>> $line = explode(':', $p);
>>> $check = $s . $line[0] . $s;
>>> if ($args['case'] != 'true') $check = strtolower($check);
>>> if ($tf === true && preg_match("/\b($find)\b/ie", $check) !=
>>> 0) $search[] = $page;
>>> elseif($tf === false && preg_match("/\b($find)\b/ie",
>>> $check) == 0) $search[] = $page;
>>> }
>>> return $search;
>>> }
>>>
>>>
>>> On Wed, Oct 2, 2019 at 3:39 AM Bruno Diazzi <[email protected]> wrote:
>>>
>>>> Thank you, Dan.
>>>> It seems to work well.
>>>> However I had to make the change not to line 356 in vers. 6.02 or line
>>>> 344 in vers. 6.01 but on line 315 (v. 6.02) or line 309 (v. 6.01).
>>>> Change to line 356 or 344 dosn't work.
>>>> There are still some problems with search:
>>>> text=elephants, text=pink elephants, text=pink||elephants work properly
>>>> text=!elephants, text=pink&&elephants dosn't work.
>>>> Cheers
>>>> Bruno
>>>>
>>>> Am Montag, 30. September 2019 19:00:59 UTC+2 schrieb Dan:
>>>>>
>>>>> Wow, that took me a good while to figure out. I don't use tags myself,
>>>>> and it turns out there is a glitch in the software added from a recent
>>>>> update that I hadn't noticed and no one had reported. :(
>>>>>
>>>>> Fortunately there's an easy fix:
>>>>>
>>>>> Go to engine.php and comment out line 357 so it looks like this:
>>>>>
>>>>> // if ($args['text'] != '') $value = BOLTMtexttools(array('',
>>>>> $args['text'], $value));
>>>>>
>>>>> At some point I added a way to integrate text formatting features
>>>>> directly into the function output, but the text= parameter is also part of
>>>>> the tagging system, so you have the conflict right there.
>>>>>
>>>>> A better way to fix it would be to change the format of the tag
>>>>> command from
>>>>>
>>>>> [(query page=index.tags text=whatever fmt='[[{+p}]]')] to [(query
>>>>> page=index.tags tag=whatever fmt='[[{+p}]]')]
>>>>>
>>>>> But that would be a bit more complicated, so I'll put that on my to do
>>>>> list to figure out how to do this optimally. And hopefully without
>>>>> breaking
>>>>> sites.
>>>>>
>>>>> Actually, thinking out loud, if you want to retain the text formatting
>>>>> capabilities, you could for now replace line 357 with these four lines:
>>>>>
>>>>> if ($args['text'] != '') {
>>>>> $value2 = BOLTMtexttools(array('', $args['text'], $value));
>>>>> if ($value2 != '') return $value2;
>>>>> }
>>>>>
>>>>> That actually seems to fully solve the conflict. And using a tag=
>>>>> parameter may not be the best approach anyway as text= is used for regular
>>>>> text based searches that don't involve tagging.
>>>>>
>>>>> Anyway, let me know if this doesn't solve the problem for you. I
>>>>> probably won't do a release for this small fix as I'm working on a bigger
>>>>> release for the near future, but will be sure to include some fix when I
>>>>> do. And it won't hurt to think about this a bit more to make sure we get
>>>>> it
>>>>> fixed right...
>>>>>
>>>>> Thanks for reporting this! I was actually thinking about adding tag
>>>>> capabilities to my own site sometime soon. Should be easier now that it is
>>>>> working!
>>>>>
>>>>> Cheers,
>>>>> Dan
>>>>>
>>>>>
>>>>> On Mon, Sep 30, 2019 at 3:34 AM Bruno Diazzi <[email protected]>
>>>>> wrote:
>>>>>
>>>>>> Hallo,
>>>>>> I need to select pages with a certain tag.
>>>>>> I have tried with action.tag: *no pages found*.
>>>>>> I have tried with [(query page=index.tags text=whatever
>>>>>> fmt='[[{+p}]]')]: *no page founds*.
>>>>>> I have tried with [(query page=index.tags #1(+)whatever
>>>>>> fmt='[[{+p}]]')]: *and this works properly*, but it isn't what I
>>>>>> need, because whatever shoud not be part of a word.
>>>>>> I need your help.
>>>>>> Thanh you.
>>>>>>
>>>>>>
>>>>>>
--
You received this message because you are subscribed to the Google Groups
"BoltWire" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/boltwire/CABnVu_7m0%2B6xQn%3DFOBDUchiPN_caOHeuyMHisf%2B0xVPPNJrU%2Bg%40mail.gmail.com.