Kinook Software Forum

Kinook Software Forum (https://www.kinook.com/Forum/index.php)
-   [UR] General Discussion (https://www.kinook.com/Forum/forumdisplay.php?f=23)
-   -   How To Search Based On Order Of Words In A Sentence? (https://www.kinook.com/Forum/showthread.php?t=4787)

cnewtonne 02-10-2011 08:19 AM

How To Search Based On Order Of Words In A Sentence?
 
My urd db has FTS enabled. I'm trying to search based on the order of words e.g.
1) Item 1 text contains "my name is cnewtonne".
2) Item 2 text contains "cnewtonne is my name"

I want to search so that it only returns the item where "cnewtonne" APPEARS AFTER "name"

I tried the following search phrases, but none worked ...

- name NEAR cewntonne: returns both.
- name .* cnewtonne: both
- "name is cnewtonne": returns first, but I can not always tell what and how many words are between 'name' and 'cnewtonne'
- Also, for the search work NEAR, how near is near?

Thank you.

kinook 02-10-2011 09:24 AM

Search for

*name * newtonne*

NEAR searches are within 10 words by default, which can be modified like this:

newtonne NEAR/5 name

See here for more details on FTS search syntax (there is a section on NEAR queries): http://www.sqlite.org/fts3.html

cnewtonne 02-10-2011 12:38 PM

This is good.
I see that NEAR does not honor order ...

So, search phrase 'one NEAR two' returns both of these ...

one comes before two
two comes after one


Also, phrase '*one * two*' returns

one comes before two
and
one is too far ... ... ... ... ...x100 from two (... represents 100 lines of text)
but NOT
two comes after one

So ...
Is there a way to have both effects. i.e. have NEAR and order together so it only returns

one comes before two


Thank you.

kinook 02-10-2011 12:48 PM

Try an advanced search with

name NEAR newtonne

in 'Search for' and

(Item) matches wildcard *name * newtonne*

in the grid.


All times are GMT -5. The time now is 07:44 PM.


Copyright © 1999-2023 Kinook Software, Inc.