Combined Searches

Hi,

I am trying to do some statistical analysis of songs for my ministerial dissertation.

2.0beta works great for finding songs with a certain word in it say "Jesus".  However I would like to perhaps find all the songs containing the words "Jesus" and "God" in it, but not necessarilly only those which have the words "Jesus God" as consecutive words in the song.  Is this possible?

Thanks

Rob

Comments

  • edited May 2011

    Yes, that would be great to search according to two criteria.

    Personally, I would like to be able to limit a search on the first criteria by whether a song is tagged as a Favourite (to avoid the wrong version being displayed, e.g. the 6 verse version of Amazing grace instead of the 4 verse version).  That would be a great alternative option to a word search for one of the criteria.  (I've noted that before at http://openlp.org/en/forums/development/feature_requests/tag_songs_as_favourites_to_reduce_list_or_search_results.html )

    But yes, an advanced search on two criteria would be great.  Even if it were words only that were searched, I've entered "(Favourite)" into the alternate title of my fav's so I could search on "(Fav" as option 1 and then choose what words to search on in option 2.

    It's on my wishlist...

  • edited June 2011

    Hi,

    OK I have written a small utility tonight to do this - sorry I don't have time to integrate it into the main code at the moment.  It is one of my aims at the end of my ministerial training to take a closer look at the code but just to busy between leading a church and study at the moment.  You will have to forgive the clunkiness of the code - this is the first python I have written since starting my training 3 years ago and my first SQL for 20 years!  You will need to adjust paths so they work on your machine... I have named the file on my machine as songInfo.py.  Hope it works as I have no way of debugging somewhere else.

    To use type

    python songInfo.py AND Father Son Spirit

    (will list all songs which include the words Father and Son and Spirit)

    python songInfo.py OR Father Son Spirit

    (will list all songs which include the words Father or Son or Spirit)

    Hmmm seem to have a problem adding code to this thread without losing indentation, I will try an upload it somewhere tomorrow and then you can download it from there.

Sign In or Register to comment.