search for: sort_field

Displaying 20 results from an estimated 22 matches for "sort_field".

2019 May 24
3
[PATCH] (vesa)menu.c32: Add support for BLS
...const char *title; + const char *version; + char *version0; /* version string padded with zeros */ + const char *machine_id; + const char *linux_; + const char *initrd; + const char *efi; + char *options; + const char *devicetree; + const char *architecture; + char *sort_field; /* used internally for sorting */ + const char *filename; +}; + +static void clear_bls_data(struct blsdata *bd) +{ + refstr_put(bd->title); + refstr_put(bd->version); + free(bd->version0); + refstr_put(bd->machine_id); + refstr_put(bd->linux_); + refstr_put(bd-&...
2019 May 25
2
[PATCH] (vesa)menu.c32: Add support for BLS
...cation. > > Any reason why you don't try to implement this in syslinux core? > > <snip> > > > +static int parse_bls1_file(struct blsdata *bd, const char *filename) > > +{ > > + FILE *f = NULL; > > + char line[MAX_LINE], *p; > > + char *sort_field; > > + > > + dprintf("Opening bls entry: %s ", filename); > > + > > + f = fopen(filename, "r"); > > + dprintf("%s\n", f ? "ok" : "failed"); > > + > > + if (!f) > > + return -1; >...
2019 May 25
0
[PATCH] (vesa)menu.c32: Add support for BLS
...files that are defined by > this new specification. Any reason why you don't try to implement this in syslinux core? <snip> > +static int parse_bls1_file(struct blsdata *bd, const char *filename) > +{ > + FILE *f = NULL; > + char line[MAX_LINE], *p; > + char *sort_field; > + > + dprintf("Opening bls entry: %s ", filename); > + > + f = fopen(filename, "r"); > + dprintf("%s\n", f ? "ok" : "failed"); > + > + if (!f) > + return -1; > + > + refstr_put(bd->filename);...
2006 Mar 01
2
Sorting the Result
The document describes search(query, options) sort: An array of SortFields describing how to sort the results. I have created index with two fields: ''file'' and ''content'' When I give SortField name as ''file'' while searching, it results into error. The exact command given by me: index.search_each("sleepless AND dreams", :num_docs
2019 May 27
0
[PATCH] (vesa)menu.c32: Add support for BLS
..."pxelinux.pathprefix" for pxelinux. > > > > <snip> > > > > > +static int parse_bls1_file(struct blsdata *bd, const char > > > *filename) +{ > > > + FILE *f = NULL; > > > + char line[MAX_LINE], *p; > > > + char *sort_field; > > > + > > > + dprintf("Opening bls entry: %s ", filename); > > > + > > > + f = fopen(filename, "r"); > > > + dprintf("%s\n", f ? "ok" : "failed"); > > > + > > > + if (!f)...
2006 Jul 12
5
Reverse sorting
I am getting strange results when I reverse sort a query. I am sorting by date, but it doesn''t seem to be related to dates (I have tried just integers). I also paginate the results. Items in the result set are sometimes duplicated and the not ordered at all. When I try a non-reverse sort I don''t see duplicates and the ordering is correct. Any ideas what is going on? Thanks
2006 Aug 20
1
sorting with booleans
...is not managing to sort the booleans. I tried declaring this in my model but it seems to have had no effect. def false.<=>(o) o ? -1 : 0 end def true.<=>(o) !o ? 1 : 0 end I''m using the acts_as_ferret plugin. below is the relevent code that i''m currently using. sort_fields = [] sort_fields << Ferret::Search::SortField.new("sponsorerd") sort_fields << Ferret::Search::SortField.new("ferret_date_registered", :reverse => :true) results = VoObject.find_by_contents(query,:first_doc=>page, :num_docs=> 20,:sort =>sort_fields)...
2006 Aug 30
7
AAF Sorting by date - what am I doing wrong?
I''m trying to sort my search results by Date, in descending order. I''ve done quite a bit of reading through the forums here, and I''ve tried two different suggestions. This just returns results in the same order as a search without a sort: sort_fields = [] sort_fields << Ferret::Search::SortField.new("ferret_created_at",:reverse => :true) Comment.find_by_contents("test", :sort => sort_fields, :num_docs => 5) This also doesn''t affect the order: Comment.find_by_contents("test", :sort => [...
2006 Oct 16
10
Sorting by score
Hi I think this is a very easy question but here goes: I want to sort my results by a boolean field and then by score, I thought this would be a default configuration but apparently not. sort_fields = [] sort_fields << Ferret::Search::SortField.new(:sponsored, :reverse => :true) that is my current code, how do iu alter it so that the results are then sorted by highest score first? thanks very much. regards caspar -- Posted via http://www.ruby-forum.com/.
2006 Jul 19
4
sorting and pagination
...ield called date_registered and have this working with pagination. here is what i''m doing at the moment: ################################ acts_as_ferret :fields=> [''short_description'',...,''date_registered''] def VoObject.find_results(query,page) sort_fields = [] sort_fields << Ferret::Search::SortField.new("date_registered", :reverse => :false) results2 = VoObject.find_by_contents(query,:num_docs=> 2000000,:sort =>sort_fields ) num = results2.size if page == 1 page = 0 else page = (page-1)*20 end results...
2006 Oct 02
6
Strange Sorting Issues
Hi there, I''m having some strange sorting stuff goign on. Here''s my search method: sort_fields = [] sort_fields << Ferret::Search::SortField.new("name", :reverse => :false) @results = Listing.find_by_contents @search_criteria, :limit => :all, :sort => sort_fields page = (params[:page] ||= 1).to_i items_per_page = 9 offset = (page - 1) * items_per_page @pa...
2019 Jul 09
0
[PATCH] core: Add support for BLS Type 1 entries
..._put(bd->version0); + refstr_put(bd->machine_id); + refstr_put(bd->freax); + free(bd->initrd); + refstr_put(bd->efi); + free(bd->options); + refstr_put(bd->devicetree); + refstr_put(bd->architecture); + refstr_put(bd->other); + refstr_put(bd->sort_field); + + memset(bd, 0, sizeof *bd); +} + +/* + * inspired by syslinux/com32/modules/ls.c:compare_dirent + */ +int compare_bls_data(const void *p_bd1, const void *p_bd2) +{ + if (!p_bd1 || !p_bd2) + return 0; + + const struct blsdata *bd1 = *(const struct blsdata **)p_bd1; + const struct bl...
2006 Oct 31
5
conditional boost? friends to come up at top of search...
Hey guys, im trying to get my friends to come up at the top of the act as ferret search. I would query the whole result set first, then move my friends to the top, but the thing is, Im paginating my results and use the offset and limit parameters in the multi_search() function. Anyone know how to do this? Thanks in advance... -- Posted via http://www.ruby-forum.com/.
2006 Jun 25
1
Sorting ferret results by column
I have the acts_as_ferret plugin installed. Everything searches great, but I would like to limit the results (i.e. by ''end_date'') and sort them (by ''end_date''). ''end_date'' is a valid column in my "posts" table. Here''s the code I have already: @posts = Post.find_by_contents(params[:query]) params[:query] comes from a form. I
2006 Jun 29
13
find_by_contents not returning SearchResults?
The acts_as_ferret documentation says find_by_content returns an instance of SearchResults, but I see this error when I try to use the results. undefined method `total_hits'' for []:Array Here is the link to the documentation: http://projects.jkraemer.net/acts_as_ferret/rdoc/classes/FerretMixin/Acts/ARFerret/ClassMethods.html#M000010 But here is the actual code: result =
2006 Jul 25
1
RDig document processing error
...ensetech.org''] cfg.index.path = ''/my/path/to/index'' cfg.verbose = true ...I get this output: $ rdig -c config/rdig_config.rb /usr/local/lib/site_ruby/1.8/ferret/index/term.rb:45: warning: method redefined; discarding old text= /usr/local/lib/site_ruby/1.8/ferret/search/sort_field.rb:69: warning: instance variable @name not initialized /usr/local/lib/site_ruby/1.8/ferret/search/sort_field.rb:69: warning: instance variable @name not initialized lib/ferret/query_parser/query_parser.y:128: warning: method redefined; discarding old initialize lib/ferret/query_parser/query_par...
2006 Dec 28
13
Sorting/Ordering Search Results
Hello All, I am having an issue with AAF and sorting results of a search. Right now, I have results being split onto pages of 10. The results are being sorted alphabetically, but not across multiple pages - it''s just sorting the 10 it pulls down on each page. I noticed another post from April regarding this same issue (http://www.ruby-forum.com/topic/62993#66934) where the issue was
2007 Jul 13
8
More sorting problems with untokenized index
I''m having problems sorting on untokenized fields. I have one field that sorts fine, but there are others that seem to sort on a different field. Here''s the index description: acts_as_ferret :remote=>true,:fields=>{:name=>{:boost=>2},:name_for_sort=>{:index => :untokenized}, :city=>{:boost=>2}, :city_for_sort=>{:index=>:untokenized},
2007 Apr 01
7
baffling sort problem
I had sort-by-date working almost perfectly with my app. It was behaving as expected for most data, but had a few hiccups with certain data. I investigated and discovered that the correct data was storing this in my ferret index: "1999-10-18 00:00:00" and the incorrect data was storing this: "Mon Oct 18 00:00:00 EDT 1999" (oops...) So I of course had to fix the
2006 Oct 13
3
Ferret 0.10.11 & AAF: sorting Time fields doesn''t work
Ferret 0.10.11 & AAF: the time seems to be stored in a format that can''t be sorted, the order doesn''t make any sense. Workaround: use to_i on the Time object before putting it into the index. -- Posted via http://www.ruby-forum.com/.