Mercurial Hosting > luan
comparison lucene/src/luan/modules/lucene/Web_search.luan @ 539:473e456444ff
Remove object-oriented primitive methods for string and binary
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Mon, 01 Jun 2015 17:53:55 -0600 |
parents | 5fed3de0aac7 |
children | 4362eb720da9 |
comparison
equal
deleted
inserted
replaced
538:919b9410008e | 539:473e456444ff |
---|---|
8 local range = Luan.range | 8 local range = Luan.range |
9 local to_string = Luan.to_string | 9 local to_string = Luan.to_string |
10 local Io = require "luan:Io" | 10 local Io = require "luan:Io" |
11 local Http = require "luan:http/Http" | 11 local Http = require "luan:http/Http" |
12 local String = require "luan:String" | 12 local String = require "luan:String" |
13 local string_to_number = String.string_to_number | |
13 local Html = require "luan:Html" | 14 local Html = require "luan:Html" |
14 | 15 |
15 local M = {} | 16 local M = {} |
16 | 17 |
17 local function form() %> | 18 local function form() %> |
138 assert_integer=assert_integer; | 139 assert_integer=assert_integer; |
139 assert_long=assert_long; | 140 assert_long=assert_long; |
140 assert_double=assert_double; | 141 assert_double=assert_double; |
141 } | 142 } |
142 local query = load(query_string,"<query>",query_env,true)() | 143 local query = load(query_string,"<query>",query_env,true)() |
143 local rows = Http.request.parameter.rows.to_number() | 144 local rows = string_to_number(Http.request.parameter.rows) |
144 local sort = load(Http.request.parameter.sort,"<sort>",{sort=index.query.sort},true)() | 145 local sort = load(Http.request.parameter.sort,"<sort>",{sort=index.query.sort},true)() |
145 index.Searcher( function(searcher) | 146 index.Searcher( function(searcher) |
146 local results, length, total_hits = searcher.search(query,rows,sort) | 147 local results, length, total_hits = searcher.search(query,rows,sort) |
147 local headers = {} | 148 local headers = {} |
148 local table = {} | 149 local table = {} |