This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.tistory.devyongsik.replication; | |
import java.io.IOException; | |
import java.util.Collection; | |
import org.apache.lucene.index.IndexCommit; | |
import org.apache.lucene.index.SnapshotDeletionPolicy; | |
import org.apache.lucene.store.FSDirectory; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FieldType fieldType = new FieldType(); | |
fieldType.setIndexed(true); | |
fieldType.setStored(true); | |
fieldType.setTokenized(true); | |
fieldType.setIndexOptions(IndexOptions.DOCS_ONLY); | |
Field field = new Field("ids", ids[i], fieldType); //int type | |
IntField intField = new IntField("price", prices[i], fieldType); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
protected TokenStreamComponents createComponents(final String fieldName, | |
final Reader reader) { | |
return new TokenStreamComponents(new WhitespaceTokenizer(matchVersion, reader)); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.tistory.devyongsik.analyzer; | |
import java.io.IOException; | |
import java.util.ArrayList; | |
import java.util.List; | |
import org.apache.commons.logging.Log; | |
import org.apache.commons.logging.LogFactory; | |
import org.apache.lucene.analysis.TokenStream; | |
import org.apache.lucene.analysis.tokenattributes.CharTermAttribute; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.tistory.devyongsik.domain; | |
import java.util.List; | |
import java.util.Map; | |
import com.thoughtworks.xstream.annotations.XStreamAlias; | |
import com.thoughtworks.xstream.annotations.XStreamAsAttribute; | |
import com.thoughtworks.xstream.annotations.XStreamOmitField; | |
@XStreamAlias("collection") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test | |
public void SearcherLifetimeSimpleTest() throws CorruptIndexException, LockObtainFailedException, IOException { | |
SearcherManager searcherManager = new SearcherManager(directory, new SearcherFactory()); | |
SearcherLifetimeManager lifetimeManager = new SearcherLifetimeManager(); | |
IndexSearcher indexSearcher = searcherManager.acquire(); | |
Term t = new Term("id", "4"); | |
Query q = new TermQuery(t); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test | |
public void NRTManagerDiffGenIndexSearcher() throws CorruptIndexException, LockObtainFailedException, IOException { | |
IndexWriter writer = getWriter(); | |
NRTManager.TrackingIndexWriter trackingIndexWriter = new NRTManager.TrackingIndexWriter(writer); | |
NRTManager nrtManager = new NRTManager(trackingIndexWriter, new SearcherFactory()); | |
long generation = nrtManager.getCurrentSearchingGen(); | |
Assert.assertEquals(0, generation); | |
IndexSearcher indexSearcher = nrtManager.acquire(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.tistory.devyongsik.search; | |
import java.io.IOException; | |
import org.apache.lucene.analysis.WhitespaceAnalyzer; | |
import org.apache.lucene.document.Document; | |
import org.apache.lucene.document.Field; | |
import org.apache.lucene.index.CorruptIndexException; | |
import org.apache.lucene.index.IndexWriter; | |
import org.apache.lucene.index.IndexWriterConfig; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.tistory.devyongsik.domain; | |
/** | |
* @author need4spd, need4spd@11st.co.kr, 2012. 10. 11. | |
* | |
*/ | |
public class Dual { | |
private String r; | |
public String getR() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package DEVYONGSIK::File; | |
use strict; | |
use warnings; | |
sub new { | |
my $self = {}; | |
$self->{FILE_NAME} = undef; | |
$self->{SRC_DIR} = undef; | |
$self->{DST_DIR} = undef; | |
$self->{IP_LIST} = []; |
OlderNewer