본문 바로가기

특정 Term에 대한 Terminfo 찾기 /** Returns the TermInfo for a Term in the set, or null. */ TermInfo get(Term term) throws IOException { if (size == 0) return null; ensureIndexIsRead(); // optimize sequential access: first try scanning cached enum w/o seeking SegmentTermEnum enumerator = getEnum(); if (enumerator.term() != null // term is at or past current && ((enumerator.prev() != null && term.compareTo(enumerator.prev())> 0.. 더보기
특정 Term에 대한 Terminfo 찾기 /** Returns the TermInfo for a Term in the set, or null. */ TermInfo get(Term term) throws IOException { if (size == 0) return null; ensureIndexIsRead(); // optimize sequential access: first try scanning cached enum w/o seeking SegmentTermEnum enumerator = getEnum(); if (enumerator.term() != null // term is at or past current && ((enumerator.prev() != null && term.compareTo(enumerator.prev())> 0.. 더보기
Lucene에서 TF, IDF 구하는 소스 package org.apache.lucene.search; /** * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the.. 더보기
Lucene에서 TF, IDF 구하는 소스 package org.apache.lucene.search; /** * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the.. 더보기
Title 필드에 test란 데이터를 색인시 6개 파일에 어떻게 저장될까? fnm, fdx, fdt 이 세개 파일엔 특별한 알고리즘이 없다. 필드를 저장할때 제일 앞에 필드 갯수 그리고 그 다음엔 필드 길이 필드 데이터 순으로 저장한다. 따라서 별도로 공부할 필요가 없을 것 같다. tis 파일에는 term text가 저장되고, frequence와 position정보의 pointer가 저장된다. frq 파일에는 frequence 정보만 저장된다. prx 파일에는 position정보만 저장된다. 뭐 어려운건 아닌데.. 예를 들면 Title 필드에 "test test" 데이터를 색인할때 fnm,fdx,fdt 파일에 Title 필드에 대한 정보가 들어가고 tis 파일에 term에 대한 정보가 들어간다. 기본적으로 tis에도 frequence 정보가 들어가는데 16이상일 경우 offse.. 더보기