Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RavenDB advanced Lucene query

Tags:

ravendb

I am really learning the ropes on both lucene and ravendb - I have the following document in Raven -

{
  "InternalEvent": {
    "Desec": "MachineInfo: 1F8BFBFF000106A5_2103933941_00155D365607_WIN-UWJJ7OPR9TM_1, UserInfo: NT AUTHORITY\\LOCAL SERVICE_3, ProcessInfo: \\Device\\HarddiskVolume1\\Windows\\System32\\taskeng.exe, Pid: 5772, ObjInfo: , EventId: New Process Stopped",
    "MachineInfo": "1F8BFBFF000106A5_2103933941_00155D365607_WIN-UWJJ7OPR9TM_1",
    "UserInfo": "NT AUTHORITY\\LOCAL SERVICE_3",
    "ProcessInfo": "\\Device\\HarddiskVolume1\\Windows\\System32\\taskeng.exe",
    "Pid": 5772,
    "ObjInfo": "",
    "EventId": "New Process Stopped",
    "Occured": "2011-08-08T23:25:31.8220000+01:00"
  },
  "Key": "6c4abf6a-156e-4224-8eac-72cde756b3c6"
}

I am querying the data base with -

var searchValue = "InternalEvent:Desec:(" + String.Join(" AND ", searchTerms) + ")";
var eventEntities = session.Advanced.LuceneQuery<EventCacheEntity>()
                                  .WaitForNonStaleResultsAsOfLastWrite()
                                  .Skip(0)
                                  .Take(_pageLimit)
                                  .Where(searchValue);

searching for anything like if searchTerms only has one term like Machine which is definately in the field desec. what am I doing wrong?

I am not too sure about nested fields in lucene query syntax- ie Internalevent:Desec ??

like image 285
NiladriBose Avatar asked Oct 11 '22 07:10

NiladriBose


1 Answers

The syntax for nested fields is InternalEvent.Desec, but I am not really sure what you are trying to do with the search terms

like image 76
Ayende Rahien Avatar answered Oct 14 '22 03:10

Ayende Rahien