예제 #1
0
 public static String[] searchContent(string prefixText, int count)
 {
     Search_gl search = new Search_gl();
     Data data = new Data();
     data.add("search", prefixText);
     Lucene_gl lucene = new Lucene_gl();
     Data list = lucene.searchLucene(data);
     return search.list(list);
 }
예제 #2
0
 protected void submit_Click(object sender, EventArgs e)
 {
     Lucene_gl lucene = new Lucene_gl();
     Data data = new Data();
     Profile_gl profile = new Profile_gl();
     profile.update(Param);
     lucene.addLucene(data);
     go("../client/profile.aspx?profile=" + Param.getString("name") + "&id=" + Param.getString("profileID"));
 }
예제 #3
0
 protected void submit_Click(object sender, EventArgs e)
 {
     Lucene_gl lucene = new Lucene_gl();
     Data data = new Data();
     Profile_gl profile = new Profile_gl();
     profile.insert(Param);
     Data list = profile.selectInserted(Param);
     lucene.addLucene(list);
     go("../client/profile.aspx?profile=" + list.getString("name") + "&id=" + list.getString("id"));
 }
예제 #4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            Data data = new Data();
            Search_gl search = new Search_gl();
            Paging_gl page = new Paging_gl();
            Profile_gl profile = new Profile_gl();
            Lucene_gl lucene = new Lucene_gl();
            Data list = null;
            data.add("search", search.searchUrlConversion(Param.getString("search")));
            data.add("page", page.getCurrentSearchPage(Param.getString("page")));
            data.add("range", Param.getString("range"));
            data.add("rate", Param.getString("rate"));

            if (data.getString("search") == "")
            {
                list = search.selectAll(data);
            }
            else
            {
                list = lucene.searchLucene(data);
            }
            int count = page.setPage(data);
            for (int i = 1; i <= count; i++)
            {
                dropDownPage.Items.Add(new ListItem(i.ToString()));
            }
            dropDownPage.SelectedValue = Param.getString("page");

            if (page.previousPage(Param.getString("page")) == true)
            {
                previous.Visible = false;
            }

            if (page.nextPage(Param.getString("page"), count) == true)
            {
                next.Visible = false;
            }
            // data.add all values in to same array, pass data array to advance search class in logical lib and split in to multiple search methods.
            if (data.getString("range") != "" && data.getString("search") != "")
            {
                int range = Convert.ToInt32(data.getString("range"));
                if (range > 0)
                {
                    data.add("address", data.getString("search"));
                    list = search.searchRadius(data);
                }
            }

            searchView.DataSource = list.Source;
            searchView.DataBind();

        }
    }
예제 #5
0
 public int findTotalPost(Data data)
 {
     Lucene_gl lucene = new Lucene_gl();
     Profile_gl profile = new Profile_gl();
     if (data.getString("search") == "")
     {
         return profile.selectAll(data).Count;
     }
     else
     {
         return lucene.searchLucene(data).Count;
     }
 }