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
from database import init_db | |
from database import db_session | |
from flask import Flask, request, session, g, redirect, url_for, abort, \ | |
render_template, flash | |
from models import User | |
app = Flask(__name__) | |
app.config.update(dict( | |
DEBUG=True, | |
SECRET_KEY='development key', |
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
//sqlalchemy_orm.py | |
from database import init_db | |
init_db() | |
from database import db_session | |
from models import User | |
u = User('admin', 'admin@localhost') | |
db_session.add(u) | |
db_session.commit() |
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
//Comment | |
package com.tistory.devyongsik.guestbook | |
class Comment { | |
String comment | |
Date dateCreated | |
Date lastUpdated | |
User user; | |
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.core.WhitespaceAnalyzer; | |
import org.apache.lucene.document.Document; | |
import org.apache.lucene.document.Field; | |
import org.apache.lucene.document.FieldType; | |
import org.apache.lucene.index.CorruptIndexException; | |
import org.apache.lucene.index.DirectoryReader; |
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.index.AtomicReaderContext; | |
import org.apache.lucene.search.ScoreDoc; | |
import org.apache.lucene.search.Scorer; | |
import org.apache.lucene.search.TopDocs; | |
import org.apache.lucene.search.TopDocsCollector; | |
import org.apache.lucene.util.PriorityQueue; |
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.core.WhitespaceAnalyzer; | |
import org.apache.lucene.document.Document; | |
import org.apache.lucene.document.Field; | |
import org.apache.lucene.document.FieldType; | |
import org.apache.lucene.index.CorruptIndexException; | |
import org.apache.lucene.index.DirectoryReader; |
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.index.AtomicReaderContext; | |
import org.apache.lucene.queries.CustomScoreProvider; | |
import org.apache.lucene.queries.CustomScoreQuery; | |
import org.apache.lucene.search.Query; | |
public class ImageHashDistanceScoreQuery extends CustomScoreQuery { |
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 java.util.Map; | |
import org.apache.lucene.index.AtomicReaderContext; | |
import org.apache.lucene.queries.function.FunctionValues; | |
import org.apache.lucene.queries.function.ValueSource; | |
import org.apache.lucene.queries.function.docvalues.FloatDocValues; |
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
https://github.com/apache/lucene-solr/blob/LUCENE2793/solr/src/java/org/apache/solr/search/function/distance/StringDistanceFunction.java |
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.repository; | |
import java.util.List; | |
import org.junit.Assert; | |
import org.junit.Test; | |
import org.junit.runner.RunWith; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.test.context.ContextConfiguration; | |
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; |