score:3
Accepted answer
public class clips_bystatechange : abstractindexcreationtask<clip>
{
public clips_bystatechange()
{
map = clips =>
from clip in clips
select new {
oldstate = clip.statechanges
.select(x => x.oldstate + "|" + x.changedat.tostring("o")),
newstate = clip.statechanges
.select(x => x.newstate + "|" + x.changedat.tostring("o"))
};
}
}
var results = session.advanced.lucenequery<clip, clips_bystatechange>()
.where(string.format(
"newstate: {{{0}|* to {0}|{1}}} and -oldstate: {{{0}|* to {0}|{2}}}",
state, since.tostring("o"), now.tostring("o")));
Source: stackoverflow.com
Related Query
- How to AND predicates in the WHERE clause in a LINQ to RavenDB query
- How to query and calculate dates in the where clause of a LINQ statement?
- How to execute a linq query for each item in a list , use it in the where clause and return a collection from the result of each query?
- How to call a method in the where clause of a LINQ query on a IQueryable object
- How can I do a LINQ query joining two entities and select what a Where on one of the entities?
- How can I keep the the logic to translate a ViewModel's values to a Where clause to apply to a linq query out of My Controller?
- LINQ query to conditionally filter on a where clause and select the values from another table
- How do I use the having clause on an aggregate in a complex group by and join query in LINQ
- How to write OrderByDescending and where clause in single LinQ query
- Query with Linq and count matches in the Where clause and project it
- How do I add a where clause to a field that is not part of the return set for LINQ query
- How to query in linq that the field that should be in the where clause is a concatenation of fields
- How to combine Where clause and group by in LINQ
- When using a LINQ Where clause on a Dictionary, how can I return a dictionary of the same type?
- linq query with dynamic predicates in where clause joined by OR
- How to use Linq and the IN clause
- how to put conditional WHERE clause within LINQ query
- How to call method/function in where clause of a LINQ query as IEnumerable object
- Removing the WHERE clause in a Linq query
- How can I have a linq query conditionally NOT apply a where clause
- Linq - How to apply a where clause on the maximum element of a list
- How to get the value of class properties with Linq query and IEnumerable
- How linq to nhibernate by join and Separate where in query
- Update query in LINQ contains all columns in WHERE clause instead of just the primary key column
- LINQ Query How to select Max value between start and end index and the index of the max value
- LinQ query Simple Where clause and many filter criteria
- LINQ query - join and where clause not being obeyed?
- How do you write a LINQ query that filters a sub table to a specific time period and sums the results of the sub table?
- How to specify where and select in a query containing ThenInclude, when either of where/select is not present in the query context?
- Using Linq to query Entity Framework with Where clause and many-to-many relation
More Query from same tag
- Instantiate and Call WCF service Asynchronously
- Return a List<int> from List<T> with an integer property?
- How to get a count in the foreign key item?
- C# is there a difference between where() and where<T>()
- Look for words in strings with LINQ
- how can I do a "locate non-coincident" query in Linq?
- LINQ-to-XML: Find the first security
- Can I using LINQ return a List<Person> from a List<String>
- Why my Linqued query is not giving me proper result?
- LINQ expression could not be translated
- IEnumerable<T> vs. Array
- Linq: multiple relationships to same table
- How to make null comparison to return false
- How to optimize this linq query to reduce the loops?
- Overriding LINQ extension methods
- Linq C# : Integer dbnull value how can I check it?
- SQL query to LINQ left outer join
- Mapping range variable EF Core to List for automapper
- Cannot implicitly convert type 'System.Collections.Generic.List<AnonymousType#1>' to 'System.Collections.Generic.IEnumerable<Models>
- DataTable Error - Can't CopyToDataTable()
- Pass Parameter on Linq Query
- Entity Framework Uninitialised Collection
- Using linq to retrieve pairs of Points from collection?
- Entity Framework Dynamic Lambda to Perform Search
- Combining multiple Select Expressions into dynamic class
- How to keep initializer list order within Select and/or SelectMany
- Linq Select Where
- Compile Expression at runtime Using Serialize.Linq
- return LINQ to list<entity>?
- LINQ to XML: Collapse mutliple levels to single list