Jump to content


Photo

Search on multiple fields with a kink


  • Please log in to reply
8 replies to this topic

#1 mjski

mjski

    Advanced Member

  • Members
  • PipPipPip
  • 39 posts

Posted 29 February 2016 - 05:18 AM

I'm trying to create a group of people associated with Virginia. First I tried any fact contains Virginia. Nice, but it included not only those in Virginia, but also those in West Virginia. Then I tried any fact contains Virginia and any fact does not contain West. Got fewer, but still those in WVA. Is there any way I can separate the Cavaliers from the Mountaineers?



#2 kbens0n

kbens0n

    Advanced Member

  • Members
  • PipPipPip
  • 3442 posts

Posted 29 February 2016 - 07:18 AM

Any fact_place_contains_, Virginia
Any fact_place_equals_Virginia

---
--- "GENEALOGY, n. An account of one's descent from an ancestor who did not particularly care to trace his own." - Ambrose Bierce
--- "The trouble ain't what people don't know, it's what they know that ain't so." - Josh Billings
---Ô¿Ô---
K e V i N


#3 Jerry Bryan

Jerry Bryan

    Advanced Member

  • Members
  • PipPipPip
  • 3442 posts

Posted 29 February 2016 - 07:26 AM

I don't think there is a  perfect solution. For example, here is an attempt at a solution that comes pretty close. As a part of your marking process first mark Any fact contains Virginia and then unmark Any fact contains West Virginia. It sounds like it would work perfectly. But what if someone was born in Virginia and died in West Virginia? I would think you would want to keep this person, but the unmarking would omit them.

 

Here's another possible trick. First, Search->Search and replace and change all occurrences of West Virginia to WVA.  We will put this back the way it's supposed to be before we are done. Second, create your group by doing your marking for Any fact contains Virginia. It will no longer get the entries from West Virginia because they now say WVA. Finally, Search->Search and replace and change all occurrences of WVA to back West Virginia. I'm sure there is something I haven't thought of that this process won't quite catch, but it seems pretty close. Since you are changing all your West Virginia references to WVA and back, you should make a backup before you start.

 

Jerry

 



#4 Jerry Bryan

Jerry Bryan

    Advanced Member

  • Members
  • PipPipPip
  • 3442 posts

Posted 29 February 2016 - 07:31 AM

Here's another possible trick. First, Search->Search and replace and change all occurrences of West Virginia to WVA.  We will put this back the way it's supposed to be before we are done. Second, create your group by doing your marking for Any fact contains Virginia. It will no longer get the entries from West Virginia because they now say WVA. Finally, Search->Search and replace and change all occurrences of WVA to back West Virginia. I'm sure there is something I haven't thought of that this process won't quite catch, but it seems pretty close. Since you are changing all your West Virginia references to WVA and back, you should make a backup before you start.

 

A bit off topic from this thread, but this example presents another reason besides poor performance of RM why dynamic groups should not be completely dynamic if ever dynamic groups were to be implemented in RM. If this Any fact contains Virginia group were to be completely dynamic, then the first time it refreshed itself it would automatically add in people who had places containing West Virginia. If instead dynamic groups were somewhat under user control and only remembered the search criteria, then the user could still use the "change West Virginia to WVA and then change it back" trick when causing the Any fact contains Virginia group to be refreshed.

 

Jerry



#5 Jerry Bryan

Jerry Bryan

    Advanced Member

  • Members
  • PipPipPip
  • 3442 posts

Posted 29 February 2016 - 07:35 AM

Kevin and I were posting at the same time. I like Kevin's solution better than mine.

 

Jerry



#6 zhangrau

zhangrau

    Advanced Member

  • Members
  • PipPipPip
  • 1482 posts

Posted 29 February 2016 - 08:34 AM

Places like Virginia, Hibbing County, MN, USA will still be included in the above searches.

 

My place naming convention uses VA, USA for Virginia and WV, USA for West Virginia. Thus, the original search and grouping on Any fact - place - contains - VA, USA would work just fine for me. But for users who don't like using state abbreviations, my system may not be desirable.



#7 kbens0n

kbens0n

    Advanced Member

  • Members
  • PipPipPip
  • 3442 posts

Posted 29 February 2016 - 08:40 AM

Places like Virginia, Hibbing County, MN, USA will still be included in the above searches.


Won't be included in mine (notice the comma and space preceding Virginia in the first criteria)

---
--- "GENEALOGY, n. An account of one's descent from an ancestor who did not particularly care to trace his own." - Ambrose Bierce
--- "The trouble ain't what people don't know, it's what they know that ain't so." - Josh Billings
---Ô¿Ô---
K e V i N


#8 Jerry Bryan

Jerry Bryan

    Advanced Member

  • Members
  • PipPipPip
  • 3442 posts

Posted 29 February 2016 - 12:03 PM

Won't be included in mine (notice the comma and space preceding Virginia in the first criteria)

 

Kevin's use of the comma and the space is why I like his solution so much.

 

Jerry



#9 mjski

mjski

    Advanced Member

  • Members
  • PipPipPip
  • 39 posts

Posted 01 March 2016 - 05:18 AM

Any fact_place_contains_, Virginia
Any fact_place_equals_Virginia

This works perfectly! I guess I was making it more difficult than it was. :blink:  You guys are great! Thanks so much.