RavenDB advanced Lucene query
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 ??
The syntax for nested fields is InternalEvent.Desec
, but I am not really sure what you are trying to do with the search terms
精彩评论