* Wild card in query parameter

Questions regarding use of any Version of Family Historian. Please ensure you have set your Version of Family Historian in your Profile. If your question fits in one of these subject-specific sub-forums, please ask it there.
Post Reply
User avatar
dewilkinson
Superstar
Posts: 286
Joined: 04 Nov 2016 19:05
Family Historian: V7
Location: Oundle, Northamptonshire, England
Contact:

Wild card in query parameter

Post by dewilkinson »

I am using a cloned version of the Name Search query and sometimes wish to use a wild card in the given name, i.e. to retrieve all instances of the surname. This is easy to do if you uncheck the parameter tick box and leave the value blank, but I was just wondering can you use wild cards when a parameter is checked as it is more convenient? I have tried the usual wild card characters such as * and it doesn't seem to work.
David Wilkinson researching Bowtle, Butcher, Edwards, Gillingham, Overett, Ransome, Simpson, and Wilkinson in East Anglia

Deterioration is contagious, and places are destroyed or renovated by the spirit of the people who go to them
User avatar
tatewise
Megastar
Posts: 28345
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Wild card in query parameter

Post by tatewise »

No David, unfortunately Queries do not support any general form of wildcard pattern matching.
However, you could modify the Given Name filter Expression to such as:
=IsTrue( (Text(["First Name"]) = "*") or ContainsText(%INDI.NAME:GIVEN_ALL%,Text(["First Name"]),STD) )
which would let the asterisk (*) Parameter value match any Given Name.

Otherwise, you would need to use a Plugin to perform general wildcard searching.
The Search and Replace Plugin has a Search Only mode, supports wildcard Lua Pattern matching, can focus on just Individual record Names, and produces a Result Set of all matching records.
You need to include the slash / separators around /Surnames/ to differentiate from Given names.
However, it does not include the Husband name search like the Query does.

This is one of those cases where it would be useful to invoke a fragment of Plugin script from within an Expression.
Then the Query Rows filter Expression could invoke a wildcard Lua Pattern as supplied by the Parameter.
See Wish List Ref 547 Run Plugins via Expressions.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
User avatar
dewilkinson
Superstar
Posts: 286
Joined: 04 Nov 2016 19:05
Family Historian: V7
Location: Oundle, Northamptonshire, England
Contact:

Re: Wild card in query parameter

Post by dewilkinson »

Mike,

Many thanks for the helpful reply, I was coming to the conclusion that wild cards are not allowed in query parameters.
David Wilkinson researching Bowtle, Butcher, Edwards, Gillingham, Overett, Ransome, Simpson, and Wilkinson in East Anglia

Deterioration is contagious, and places are destroyed or renovated by the spirit of the people who go to them
User avatar
tatewise
Megastar
Posts: 28345
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Wild card in query parameter

Post by tatewise »

On closer investigation the Given Name filter Expression that I suggested does NOT work quite as expected.

Unfortunately, the ContainsText(...) function ignores the :GIVEN_ALL qualifier.
So the First Name parameter value will match anywhere in the NAME field.

I have tried several variations on that theme without success.
The ContainsText(...) function simply works differently to the Query filter Operator for contains.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
User avatar
dewilkinson
Superstar
Posts: 286
Joined: 04 Nov 2016 19:05
Family Historian: V7
Location: Oundle, Northamptonshire, England
Contact:

Re: Wild card in query parameter

Post by dewilkinson »

Mike,

Thank you very much for your effort and thoughts, much appreciated. The simplest solution for me is not to use a parameter and just leave the value field blank in the query window for the GIVEN NAME and use contains for part of a SURNAME when I want to retrieve all instances of that SURNAME.
David Wilkinson researching Bowtle, Butcher, Edwards, Gillingham, Overett, Ransome, Simpson, and Wilkinson in East Anglia

Deterioration is contagious, and places are destroyed or renovated by the spirit of the people who go to them
Post Reply