Search Inside Words does not work

Clairvaux
Posts: 65
Joined: Sun Dec 25, 2016 12:43 pm
Contact:

Search Inside Words does not work

Postby Clairvaux » Sat Jun 17, 2017 7:49 am

Searching with Search Inside Words unchecked (default setting) brings up results that should only appear with that option checked.

The online help says :
By default, CintaNotes searches only from the word boundaries. This means that e.g. when you search for "nation", notes containing the word “international” won’t be found. If you want to search also inside of words, you need to activate the Search Inside Words option.

However, leaving Search Inside Words unchecked, and searching for "interna" anywhere brings many instances of "international", as well as "internal". Checking Search Inside Words in that case does increase the count of notes found (but there are two many for me to understand the difference).

It seems Search Inside Words makes (uncorrectly) an exception for strings at the beginning of a word.

This is verified by searching for "gero" with Search Inside Words unchecked, which brings only a few notes including words beginning with "gero" (obviously no such complete word) ; whereas checking Search Inside Words brings up a whole lot more, containing "dangerous" and "dangerously".

Similarly, searching for "dential" with Search Inside Words unchecked brings up almost nothing, however checking Search Inside Words brings up a great number of notes containing "confidential", "presidential" and such.

Another, associated bug is that sometimes, searching will bring up notes with no characters highlighted, so you won't know why they have been found (or whether they should have been).

In the above example, searching for "dential" with Search Inside Words unchecked brings up only 4 notes among 2 000, none of them having anything highlighted at all.

Opening them one by one and using the Search function within the editor shows they should not have been found : none of them include a "dential" word, however all of them include words such as "presidential" or "credentials".

In that example, the search function within a note works correctly, finding nothing when Search Inside Words is unchecked, and finding "presidential" and such when it is.

Reflecting the global search function behaviour, searching "interna" with the search function within a note will find "international", whether Search Inside Words is checked or not, which is incorrect.

***

Clairvaux

CN v.3.8 portable
Windows 7 64-bit
date
Posts: 243
Joined: Sat Aug 01, 2015 5:15 am
Contact:

Re: Search Inside Words does not work

Postby date » Sat Jun 17, 2017 11:18 am

Inside words is 'in addition to' word starts. If search criteria is set to 'Everywhere' and nothing is highlighted maybe something is found in the link, could that be it? Seems working correctly to me.
gunars
Posts: 234
Joined: Fri Nov 08, 2013 5:35 am
Contact:

Re: Search Inside Words does not work

Postby gunars » Sat Jun 17, 2017 4:32 pm

When typing in the search word with Search inside words off, CN lists all notes that have words that start with the text typed in so far. When you type 'i', it lists all notes with words that start with 'i'. As you type more letters, it gradually narrows down the displayed notes to have words that start with what has been typed so far (incremental search). You can see this gradual refinement with each additional letter you type. So when you type 'interna', it lists all notes that have words that start with 'interna'. This appears to be working correctly. If I understand correctly, what you're expecting is that typing 'interna' should match only complete words 'interna', not just words that start with it. Some editors (e.g. notepad++) do have an option for 'match whole word only', but CN does not do that.

In addition to the above, if you turn on Search within words, it will match not only at the beginnings of words, but also occurrences within words.

As for the lack of highlighting, I agree with date - check all other fields (title, tags, remarks, links, attachments) to see if the text appears there. I think CN only highlights hits in the body of notes. If you still don't see the text, I'd suggest exporting that note (with all fields) and looking at the generated xml in an editor.

And if you're adventurous, ask Alex sometime about how search, search inside words, punctuation, accented characters relate to SQL MATCH, LIKE and LIKEWORD :ugeek:
Clairvaux
Posts: 65
Joined: Sun Dec 25, 2016 12:43 pm
Contact:

Re: Search Inside Words does not work

Postby Clairvaux » Mon Jun 19, 2017 2:27 pm

Thank you for your clarification, Date and Gunars. I still insist that Search Inside Words does not work.

I'll assume what both of you wrote is correct, and that CN actually works the way you (and I) said : you confirm my hypothesis that Don't Search Inside Words makes an exception for what's inside words, but at the beginning.


1. CN does not do what it says. Search Inside Words says "inside". It does not say : "inside, but at the end or in the middle". "Inter" within "international" is inside. Therefore, it should not be found by default.


2. The online help does not... help. I read it a good dozen times before writing my post, and I was 100 % sure that it confirmed my interpretation of the command. As a matter of fact, it does :

If you want to search also inside of words, you need to activate the Search Inside Words option.


But it also has an example that confused me :

e.g. when you search for "nation", notes containing the word “international” won’t be found.


This seems at first to confirm my interpretation, that is : "inside words" means part of word, and "not inside words" means whole word only. But "nation" is in the middle of "international", so this single example does not cover what happens when the searched string is at the beginning or at the end of a word.

I have now re-read the first sentence of the explanation, and realise I had overlooked it :

By default, CintaNotes searches only from the word boundaries.


This is a very convoluted (and wrong) way of saying : CN, by default, searches starting from the first character of a word, going rightwards, and declares it a match if and when it finds the searched string.

It's also wrong, because CN does not, by default, search from the word boundaries (apparently). If it did, it would also declare a match if the searched string was inside a word, but at the end. A word has two boundaries.

So the online help says one thing, and the opposite at the same time. The result is, everybody understands it according to his own expectations.

I expected "inside words" to mean "part of a word" (which it does, in plain English), and CN "expects" it to mean "string not starting at the beginning of a word".


3. I will now argue that it's my expectations which are correct, i.e. that's the way the software should behave in the user's interest (as opposed to the way it does behave, without really explaining it outright).

The natural way the user conducts a search is, either he wants to search precisely for a word, or he tolerates that his search string be part of a word, anywhere inside that word, in order to cast a wider net. That choice is for him to make ; the software should not try to second-guess him.

Indeed, that's how most software behaves. That's how a Word search is conducted. That's what human logic dictates. I suspect what we have here is a case of computer logic taking front stage, for historic reasons. You seem to confirm this, Gunars, when you say :

And if you're adventurous, ask Alex sometime about how search, search inside words, punctuation, accented characters relate to SQL MATCH, LIKE and LIKEWORD


My point is : a user should never, ever, under any circumstances, be compelled to wonder how anything at all relates to SQL MATCH, LIKE and LIKEWORD.


4. My suggestion would be : change this. Substitute (or, rather, add) whole word / part of word search to the current, confusing state of things.

Barring this (I realise it might not be doable without a major rewriting of the program), change the text in the online help and in the menus, to make it coincide with the (not obvious at all) behaviour of the software.

If the change from a cascading Options menu to a comprehensive Preferences window is confirmed, it will be easier to explain there what this search option really means (an added benefit of a Preferences window, by the way). Also, better use a fuzzy, but true and meaningful denomination (for instance : More Results), than a precise but false one (Search Inside Words).
date
Posts: 243
Joined: Sat Aug 01, 2015 5:15 am
Contact:

Re: Search Inside Words does not work

Postby date » Mon Jun 19, 2017 6:51 pm

If you want to search also inside of words, you need to activate the Search Inside Words option.
'Also.'

By default, CintaNotes searches only from the word boundaries.
'From.' Ok, perhaps less clear. But it is similar to how Google searches.
User avatar
CintaNotes Developer
Site Admin
Posts: 5001
Joined: Fri Dec 12, 2008 4:45 pm
Contact:

Re: Search Inside Words does not work

Postby CintaNotes Developer » Tue Jun 20, 2017 6:33 am

By default, CN searches from the word start. So "intern" will match "international".
This is typically what you want, because most of the time you don't even need to finish the word to find the needed note.

"Search inside words" allows to search for something that begins inside of a word. To find "nation" in "international" you have to use SIW.

If there are any questions left, please ask below
Alex

Return to “Bug Reports”