[GeoNetwork-devel] Using regex in search

Hello all,

Is there a way of using regular expression in Lucen search?

For example I might be looking for the following codes (uuid):
urn:x-wmo:md:int.wmo.wis::USTH*01*VTBB
or
urn:x-wmo:md:int.wmo.wis::USTH*10*VTBB
or
urn:x-wmo:md:int.wmo.wis::USTH*38*VTBB

In that case I could use a regex such as:
urn:x-wmo:md:int.wmo.wis::USTH*[0-3][0-9]*VTBB

In PostgreSQL it would work using /SIMILAR TO/ operator but what about
Lucene?

Txs in advance,

Mat

--
View this message in context: http://osgeo-org.1560.n6.nabble.com/Using-regex-in-search-tp4913026p4913026.html
Sent from the GeoNetwork developer mailing list archive at Nabble.com.

hello Mat,

I think it’s possible in Lucene using RegExQuery (see http://lucene.apache.org/core/3_6_0/api/all/org/apache/lucene/search/regex/RegexQuery.html).

However in GeoNetwork this is not used, if that’s what you mean…

Kind regards,
Heikki Doeleman

On Tue, Apr 24, 2012 at 12:06 PM, chOof <mounkye@anonymised.com> wrote:

Hello all,

Is there a way of using regular expression in Lucen search?

For example I might be looking for the following codes (uuid):
urn:x-wmo:md:int.wmo.wis::USTH01VTBB
or
urn:x-wmo:md:int.wmo.wis::USTH10VTBB
or
urn:x-wmo:md:int.wmo.wis::USTH38VTBB

In that case I could use a regex such as:
urn:x-wmo:md:int.wmo.wis::USTH*[0-3][0-9]*VTBB

In PostgreSQL it would work using /SIMILAR TO/ operator but what about
Lucene?

Txs in advance,

Mat


View this message in context: http://osgeo-org.1560.n6.nabble.com/Using-regex-in-search-tp4913026p4913026.html
Sent from the GeoNetwork developer mailing list archive at Nabble.com.


Live Security Virtual Conference
Exclusive live event will cover all the ways today’s security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/


GeoNetwork-devel mailing list
GeoNetwork-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geonetwork-devel
GeoNetwork OpenSource is maintained at http://sourceforge.net/projects/geonetwork

Hello Heikki,

Yes that's what I meant.
I guess I could add a new condition 'RegExQuery' in LuceneSearcher using
this RegExQuery in that case.

Thanks,
Mat

--
View this message in context: http://osgeo-org.1560.n6.nabble.com/Using-regex-in-search-tp4913026p4945610.html
Sent from the GeoNetwork developer mailing list archive at Nabble.com.