내가 가진 다음지도/I가 변환
내가 실행
다음과 같은 하나의 기술, "NH"와 "MVC"두 위치, 각각 고용주 개체가public class PositionSearch : AbstractIndexCreationTask<Employer>
{
public PositionSearch()
{
Map = employers =>
from employer in employers
from position in employer.Positions
select new
{
EmployerName = employer.Name,
SearchSkills = position.RequiredSkills
.Select(x => x.Skill)
};
TransformResults = (database, results) =>
from result in results
from position in result.Positions
select new
{
EmployerId = result.Id,
EmployerName = result.Name,
PositionId = position.Id,
PositionTitle = position.Title,
RequiredSkills = position.RequiredSkills
.Select(x => new { x.Skill, x.Proficiency })
};
// Any field you are going to use .Search() on should be analyzed.
Index("SearchSkills", FieldIndexing.Analyzed);
}
}
변환 필터 쿼리 예상 한 두 위치 결과가 반환됩니다. 왜 이런 식으로 행동하는지 누가 알 수 있습니까? 나는 그것이 내가하고있는 조인과 관련이 있다고 느낀다. 그러나 나는 확실하지 않다. 나는 순서의 임시-색인 점수를 메타 데이터에 액세스 할 수 있도록 변환 사용 꿔
using (var session = DocumentStore.OpenSession())
{
var results = session.Query<PositionSearchResultModel, PositionSearch>()
.Customize(x => x.WaitForNonStaleResults())
.Search(x => x.SearchSkills, "NH")
.OfType<PositionSearchResultModel>().ToList();
Assert.AreEqual(1, results.Count());
}
, 나는 변환 지금까지하지 않고 메타 데이터에 액세스 할 수 없었습니다.
질문 제목에서 태그를 제거했습니다. http://meta.stackexchange.com/questions/19190/should-questions-include-tags-in-their-titles을 참조하십시오. – GolfWolf