I have a postgres database that has a few tables with columns of type TEXT. These columns store unstructured text.
I want to be able to search the text columns for specific things and also be able to do full text searches. After reading the documentation on the postgres website I can successfully perform ft searches on the columns, but I am having trouble pulling out specific things.
For example lets say in my unstructured text I have some URL's. According to this document http://www.postgresql.org/docs/8.4/interactive/textsearch-parsers.html the default full text parser for postgres will specifically parse URL's. But how do I perform a query that says, "For this table, give me every row where the text column contains a URL.?" I have a feeling I should just use regular expressions for this, but the ft parser is already parsing URL's so I was wondering if there was a way to sort of use it for that.
Also, what if I want to pull out something that the default parser does not look for? I can't seem to find a lot of information about how to extended the parser and add new items.
I know I am trying to use the ft search for something that its not EXACTLY intended for, but if it works it would make my queries a lot easier.
I want to be able to search the text columns for specific things and also be able to do full text searches. After reading the documentation on the postgres website I can successfully perform ft searches on the columns, but I am having trouble pulling out specific things.
For example lets say in my unstructured text I have some URL's. According to this document http://www.postgresql.org/docs/8.4/interactive/textsearch-parsers.html the default full text parser for postgres will specifically parse URL's. But how do I perform a query that says, "For this table, give me every row where the text column contains a URL.?" I have a feeling I should just use regular expressions for this, but the ft parser is already parsing URL's so I was wondering if there was a way to sort of use it for that.
Also, what if I want to pull out something that the default parser does not look for? I can't seem to find a lot of information about how to extended the parser and add new items.
I know I am trying to use the ft search for something that its not EXACTLY intended for, but if it works it would make my queries a lot easier.